feat(home): add git config with example configuration for non-NixOS

This commit is contained in:
2025-12-03 14:32:51 +01:00
parent a9ffcc12ee
commit fdbe4366e1
9 changed files with 64 additions and 13 deletions

View File

@@ -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

View File

@@ -0,0 +1,2 @@
[user]
email = your.email@example.com

13
dots/.gitconfig.work Normal file
View File

@@ -0,0 +1,13 @@
[include]
path = ~/.gitconfig.work.email
[core]
longpaths = true
[user]
name = Hektor Misplon
username = hektor.misplon
signingKey = 1C88BE828184CEE6
[commit]
gpgsign = false

View File

@@ -0,0 +1,2 @@
[user]
email = your.work.email@example.com

View File

@@ -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;

View File

@@ -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 {

View File

@@ -2,6 +2,7 @@
programs.git.enable = true;
home.file = {
".gitconfig".source = ../../dots/.gitconfig;
".gitconfig.work".source = ../../dots/.gitconfig.work;
".gitignore".source = ../../dots/.gitignore;
};
}

11
home/modules/k9s.nix Normal file
View File

@@ -0,0 +1,11 @@
{
programs.k9s = {
enable = true;
settings.k9s = {
ui = {
logoless = true;
reactive = true;
};
};
};
}

View File

@@ -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"}
'';
};
};
};
}