41 lines
1.0 KiB
Nix
41 lines
1.0 KiB
Nix
{ config, lib, ... }: {
|
|
|
|
options.homeconfig.git.enable = lib.options.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
|
|
config = lib.mkIf config.homeconfig.git.enable {
|
|
|
|
sops.secrets."git/username" = {};
|
|
sops.secrets."git/email" = {};
|
|
|
|
sops.templates.gitconfig.content = ''
|
|
[user]
|
|
name = "${config.sops.placeholder."git/username"}"
|
|
email = "${config.sops.placeholder."git/email"}"
|
|
'';
|
|
|
|
programs.git = {
|
|
enable = true;
|
|
|
|
includes = [
|
|
{ path = "${config.sops.templates.gitconfig.path}"; }
|
|
];
|
|
|
|
extraConfig = {
|
|
init = {
|
|
defaultBranch = "master";
|
|
};
|
|
url = {
|
|
"ssh://gitea@gitea.blunkall.us/" = {
|
|
insteadOf = [
|
|
"blunkall:"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|