nix-config/modules/shell/git.nix

30 lines
693 B
Nix
Raw Normal View History

2023-10-14 18:53:32 +02:00
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
2023-10-15 14:29:15 +02:00
home.file.".ssh/allowed_signers".text = "* ${builtins.readFile ../../rsc/config/git/git.pub}";
home.file.".ssh/git.pub" = {
source = ../../rsc/config/git/git.pub;
};
2023-10-14 18:53:32 +02:00
programs.git = {
enable = true;
userName = "GHOSCHT";
userEmail = "31184695+GHOSCHT@users.noreply.github.com";
2023-10-15 14:29:15 +02:00
extraConfig = {
# Sign all commits using ssh key
2023-11-11 15:41:02 +01:00
commit.gpgsign = false;
2023-10-15 14:29:15 +02:00
gpg.format = "ssh";
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
user.signingkey = "~/.ssh/git.pub";
init.defaultBranch = "main";
2023-10-15 14:29:15 +02:00
};
2023-10-14 18:53:32 +02:00
};
};
}