1
0

Compare commits

...

2 Commits

4 changed files with 128 additions and 48 deletions

View File

@ -5,9 +5,7 @@
modules_hm_path = modules_base_path + "/home-manager";
in [
# Reusable modules
"${modules_hm_path}/alacritty.nix"
"${modules_hm_path}/zsh.nix"
"${modules_hm_path}/git.nix"
"${modules_hm_path}/ssh.nix"
"${modules_hm_path}/go.nix"
"${modules_hm_path}/utils.nix"
@ -26,7 +24,7 @@
# Host specific
./services.nix
];
] ++ (import ../../../modules/home-manager { });
# Almost static information
home = {
@ -75,10 +73,18 @@
];
};
# Custom modules (./modules/home-manager)
hm = {
alacritty.enable = true;
git = {
enable = true;
signingKey = "A12925470298BFEE7EE092B3946E2D0C410C7B3D";
};
};
programs = {
home-manager.enable = true;
cava.enable = true;
git.signing.key = "A12925470298BFEE7EE092B3946E2D0C410C7B3D";
gpg = {
enable = true;

View File

@ -1,26 +1,61 @@
{ ... }:
{ config, lib, options,... }:
with lib;
let
cfg = config.hm.alacritty;
enable = mkEnableOption "alacritty";
themes = mkOption {
type = types.listOf types.path;
default = [];
description = "List of themes to install";
example = [
(builtins.fetchurl {
url = "https://example.com/theme.toml";
sha256 = fakeSha256;
})
];
};
opacity = mkOption {
type = types.float;
default = 0.9;
description = "Window opacity";
example = 1.0;
};
fontSize = mkOption {
type = types.int;
default = 12;
description = "Font size";
example = 14;
};
in
{
programs.alacritty = {
enable = true;
settings = {
import = [
(builtins.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/alacritty/832787d6cc0796c9f0c2b03926f4a83ce4d4519b/catppuccin-macchiato.toml";
sha256 = "1iq187vg64h4rd15b8fv210liqkbzkh8sw04ykq0hgpx20w3qilv";
})
];
env.TERM = "xterm-256color";
font = {
size = 12;
normal = {
family = "FiraCode Nerd Font";
style = "Retina";
options.hm.alacritty = {
inherit enable themes opacity fontSize;
};
config = mkIf cfg.enable {
programs.alacritty = {
enable = true;
settings = {
import = [
(builtins.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/alacritty/832787d6cc0796c9f0c2b03926f4a83ce4d4519b/catppuccin-macchiato.toml";
sha256 = "1iq187vg64h4rd15b8fv210liqkbzkh8sw04ykq0hgpx20w3qilv";
})
] ++ cfg.themes;
env.TERM = "xterm-256color";
font = {
size = cfg.fontSize;
normal = {
family = "FiraCode Nerd Font";
style = "Retina";
};
};
scrolling.multiplier = 5;
selection.save_to_clipboard = true;
window = {
opacity = cfg.opacity;
};
};
scrolling.multiplier = 5;
selection.save_to_clipboard = true;
window = {
opacity = 0.9;
};
};
};

View File

@ -0,0 +1,5 @@
{ ... }:
[
./git.nix
./alacritty.nix
]

View File

@ -1,27 +1,61 @@
{ ... }:
{ config, lib, options, ... }:
with lib;
let
cfg = config.hm.git;
enable = mkEnableOption "git";
signingKey = mkOption {
type = types.nonEmptyStr;
description = "The GPG key to use for signing commits";
example = "A12925470298BFEE7EE092B3946E2D0C410C7B3D";
};
user = mkOption {
type = types.attrs;
description = "user information for git";
default = {
name = "DataHearth";
email = "dev@antoine-langlois.net";
};
};
extraConfig = mkOption {
type = types.attrs;
description = "Extra git configuration";
default = {};
};
extraAliases = mkOption {
type = types.attrs;
description = "Extra git aliases";
default = {};
};
in
{
programs.git = {
enable = true;
aliases = {
co = "checkout";
p = "push";
a = "add";
c = "commit";
s = "status";
pu = "pull";
logs = "log --graph --oneline";
remote-update = "remote update origin --prune";
};
difftastic.enable = true;
lfs.enable = true;
signing = {
signByDefault = true;
};
userEmail = "dev@antoine-langlois.net";
userName = "DataHearth";
extraConfig = {
init.defaultBranch = "main";
safe.directory = [ "/etc/nixos" ];
options.hm.git = {
inherit enable signingKey user extraConfig extraAliases;
};
config = mkIf cfg.enable {
programs.git = {
enable = true;
aliases = {
co = "checkout";
p = "push";
c = "commit";
s = "status";
pu = "pull";
logs = "log --graph --oneline";
remote-update = "remote update origin --prune";
} // cfg.extraAliases;
difftastic.enable = true;
lfs.enable = true;
signing = mkIf (builtins.hasAttr "signingKey" cfg) {
signByDefault = true;
key = cfg.signingKey;
};
userName = cfg.user.name;
userEmail = cfg.user.email;
extraConfig = {
init.defaultBranch = "main";
} // cfg.extraConfig;
};
};
}