36 lines
1.0 KiB
Nix
36 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 {
|
|
|
|
programs.git = {
|
|
userName._secret = if (!config.homeconfig.home-manager.enable) then
|
|
config.home-manager.nathan.sops.secrets."git/username"
|
|
else
|
|
config.sops.secrets."git/username";
|
|
|
|
userEmail._secret = if (!config.homeconfig.home-manager.enable) then
|
|
config.home-manager.nathan.sops.secrets."git/email"
|
|
else
|
|
config.sops.secrets."git/email";
|
|
|
|
extraConfig = {
|
|
init = {
|
|
defaultBranch = "master";
|
|
};
|
|
url = {
|
|
"ssh://gitea@gitea.blunkall.us/" = {
|
|
insteadOf = [
|
|
"blunkall:"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|