nix-config/modules/shell/git.nix
GHOSCHT 217026d0a4 Set default git branch name
default branch name is now "main" instead of "master"
2023-12-03 15:00:54 +01:00

29 lines
693 B
Nix

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