refactor(home): simplify git module

This commit is contained in:
Felix Schröter 2023-01-07 17:24:59 +01:00
parent a2c9754555
commit f260cc678b
Signed by: felschr
GPG key ID: 671E39E6744C807D

View file

@ -17,7 +17,7 @@ in {
defaultProfile = mkOption { type = types.str; }; defaultProfile = mkOption { type = types.str; };
}; };
config = let profiles = cfg.profiles; config = let inherit (cfg) profiles;
in { in {
programs.git = { programs.git = {
# fix/workaround for https://github.com/NixOS/nixpkgs/issues/169193 # fix/workaround for https://github.com/NixOS/nixpkgs/issues/169193
@ -29,13 +29,7 @@ in {
includes = flatten (mapAttrsToList (name: profile: includes = flatten (mapAttrsToList (name: profile:
map (dir: { map (dir: {
condition = "gitdir:${dir}"; condition = "gitdir:${dir}";
contents = { contents.user = { inherit (profile) name email signingKey; };
user = {
name = profile.name;
email = profile.email;
signingKey = profile.signingKey;
};
};
}) profile.dirs) profiles); }) profile.dirs) profiles);
}; };
}; };