diff --git a/dots/.gitconfig b/dots/.gitconfig index feff57a..7bcce87 100644 --- a/dots/.gitconfig +++ b/dots/.gitconfig @@ -1,9 +1,11 @@ +[include] + path = ~/.gitconfig.email + [core] editor = nvim excludesfile = ~/.gitignore [user] - email = hektor.misplon@pm.me name = Hektor Misplon username = hektor signingKey = AEB98353B8D72E465C4236435151AF79E723F21C @@ -76,8 +78,6 @@ [merge] tool = nvimdiff conflictstyle = diff3 -[pull] - rebase = true [diff] colorMoved = zebra [commit] @@ -85,3 +85,11 @@ [interactive] singleKey = true + +[pull] + rebase = true +[rerere] + enabled = true + +[includeIf "gitdir:~/work/"] + path = ~/.gitconfig.work diff --git a/dots/.gitconfig.email.example b/dots/.gitconfig.email.example new file mode 100644 index 0000000..acd2388 --- /dev/null +++ b/dots/.gitconfig.email.example @@ -0,0 +1,2 @@ +[user] + email = your.email@example.com diff --git a/dots/.gitconfig.work b/dots/.gitconfig.work new file mode 100644 index 0000000..4878c22 --- /dev/null +++ b/dots/.gitconfig.work @@ -0,0 +1,13 @@ +[include] + path = ~/.gitconfig.work.email + +[core] + longpaths = true + +[user] + name = Hektor Misplon + username = hektor.misplon + signingKey = 1C88BE828184CEE6 + +[commit] + gpgsign = false diff --git a/dots/.gitconfig.work.email.example b/dots/.gitconfig.work.email.example new file mode 100644 index 0000000..d6c0105 --- /dev/null +++ b/dots/.gitconfig.work.email.example @@ -0,0 +1,2 @@ +[user] + email = your.work.email@example.com diff --git a/home/hosts/astyanax/default.nix b/home/hosts/astyanax/default.nix index 68f836d..e99be13 100644 --- a/home/hosts/astyanax/default.nix +++ b/home/hosts/astyanax/default.nix @@ -12,6 +12,7 @@ in imports = [ ../../modules/dconf.nix # TODO: Only enable when on Gnome? ../../modules/git.nix + ../../modules/k9s.nix (import ../../modules/taskwarrior.nix { inherit config; inherit pkgs; diff --git a/home/hosts/work/default.nix b/home/hosts/work/default.nix index c1be3e0..4ca3f9c 100644 --- a/home/hosts/work/default.nix +++ b/home/hosts/work/default.nix @@ -10,21 +10,15 @@ let in { imports = [ - ../../modules/dconf.nix # TODO: Only enable when on Gnome? + ../../modules/dconf.nix + ../../modules/git.nix + ../../modules/k9s.nix ]; home.stateVersion = "25.05"; home.username = username; home.homeDirectory = "/home/${username}"; - sops = { - defaultSopsFile = "${builtins.toString inputs.nix-secrets}/secrets.yaml"; - defaultSopsFormat = "yaml"; - age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt"; - - secrets."test" = { }; - }; - nixGL = { packages = inputs.nixgl.packages; defaultWrapper = "mesa"; @@ -37,7 +31,6 @@ in inherit pkgs; inherit config; }; - git = import ../../modules/git.nix; keepassxc = import ../../modules/keepassxc.nix; }; home.packages = import ./packages.nix { diff --git a/home/modules/git.nix b/home/modules/git.nix index 7f1c33b..00634b5 100644 --- a/home/modules/git.nix +++ b/home/modules/git.nix @@ -2,6 +2,7 @@ programs.git.enable = true; home.file = { ".gitconfig".source = ../../dots/.gitconfig; + ".gitconfig.work".source = ../../dots/.gitconfig.work; ".gitignore".source = ../../dots/.gitignore; }; } diff --git a/home/modules/k9s.nix b/home/modules/k9s.nix new file mode 100644 index 0000000..914d9c2 --- /dev/null +++ b/home/modules/k9s.nix @@ -0,0 +1,11 @@ +{ + programs.k9s = { + enable = true; + settings.k9s = { + ui = { + logoless = true; + reactive = true; + }; + }; + }; +} diff --git a/modules/secrets/default.nix b/modules/secrets/default.nix index 1b973ae..e965f0c 100644 --- a/modules/secrets/default.nix +++ b/modules/secrets/default.nix @@ -25,6 +25,8 @@ in "taskwarrior_sync_server_url".owner = config.users.users.${cfg.username}.name; "taskwarrior_sync_server_client_id".owner = config.users.users.${cfg.username}.name; "taskwarrior_sync_encryption_secret".owner = config.users.users.${cfg.username}.name; + "email_personal".owner = config.users.users.${cfg.username}.name; + "email_work".owner = config.users.users.${cfg.username}.name; }; templates."taskrc.d/sync" = { @@ -35,6 +37,24 @@ in sync.encryption_secret=${config.sops.placeholder."taskwarrior_sync_encryption_secret"} ''; }; + + templates.".gitconfig.email" = { + owner = config.users.users.${cfg.username}.name; + path = "/home/${cfg.username}/.gitconfig.email"; + content = '' + [user] + email = ${config.sops.placeholder."email_personal"} + ''; + }; + + templates.".gitconfig.work.email" = { + owner = config.users.users.${cfg.username}.name; + path = "/home/${cfg.username}/.gitconfig.work.email"; + content = '' + [user] + email = ${config.sops.placeholder."email_work"} + ''; + }; }; }; }