refactor(home): simplify git module
This commit is contained in:
parent
a2c9754555
commit
f260cc678b
|
@ -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);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue