Skip to content

Commit 495d800

Browse files
committed
Git as a module.
1 parent 0907a60 commit 495d800

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

flake.nix

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,46 @@
5656
make-git = import ./git;
5757
controlling = import ./controlling;
5858
};
59+
nixosModules.git =
60+
{
61+
config,
62+
pkgs,
63+
lib,
64+
...
65+
}:
66+
let cfg = config.active-group.git;
67+
in
68+
{
69+
options.active-group.git = {
70+
enable = lib.mkEnableOption "git";
71+
userName = lib.mkOption {
72+
type = lib.types.nonEmptyStr;
73+
};
74+
userEmail = lib.mkOption {
75+
type = lib.types.nonEmptyStr;
76+
};
77+
};
78+
config = lib.mkIf cfg.enable {
79+
programs.git = {
80+
enable = true;
81+
userName = cfg.userName;
82+
userEmail = cfg.userEmail;
83+
ignores = [
84+
".DS_Store"
85+
"*~"
86+
"\\#*\\#"
87+
".\\#*"
88+
];
89+
extraConfig = {
90+
core.askPass = "";
91+
init.defaultBranch = "main";
92+
submodule.recurse = true;
93+
pull.rebase = false;
94+
};
95+
};
96+
};
97+
};
98+
5999
};
60100
};
61101
}

0 commit comments

Comments
 (0)