Files
Olympus/home-manager/nathan/programs/git/default.nix
2025-08-16 00:43:24 -05:00

38 lines
1.1 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 = {
enable = true;
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:"
];
};
};
};
};
};
}