Files
nix/modules/git/default.nix
T
2026-11-06 16:36:46 +01:00

24 lines
495 B
Nix

{ lib, config, ... }:
let
cfg = config.git;
inherit (config.host) username;
owner = config.users.users.${username}.name;
in
{
options.git.enable = lib.mkEnableOption "git";
config = lib.mkIf cfg.enable {
sops.templates = lib.genAttrs' [ "personal" "work" ] (
key:
lib.nameValuePair ".gitconfig.${key}.email" {
inherit owner;
content = ''
[user]
email = ${config.sops.placeholder."email/${key}"}
'';
}
);
};
}