aboutsummaryrefslogtreecommitdiff
path: root/snowfall/modules/home/tools/git/default.nix
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2025-02-07 05:31:59 -0800
committerCaroline Larimore <caroline@larimo.re>2025-04-14 18:58:47 -0700
commiteb16a7d8d9a90e88a1ec8d5c65d91db021b4e1e1 (patch)
tree341c6c91c64f68c85210e8f20c493991ceaba3b7 /snowfall/modules/home/tools/git/default.nix
parent4e0d8adb6fb1bb143a15b2b0ed80a82c58fbb317 (diff)
migration: git config
Diffstat (limited to 'snowfall/modules/home/tools/git/default.nix')
-rw-r--r--snowfall/modules/home/tools/git/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/snowfall/modules/home/tools/git/default.nix b/snowfall/modules/home/tools/git/default.nix
new file mode 100644
index 0000000..8aebfd8
--- /dev/null
+++ b/snowfall/modules/home/tools/git/default.nix
@@ -0,0 +1,46 @@
+{ options, config, lib, namespace, ... }:
+
+with lib; with lib.${namespace}; let
+ cfg = config.${namespace}.tools.git;
+in {
+ options.${namespace}.tools.git = with types; {
+ enable = mkEnableOption "git";
+
+ name = mkOption {
+ type = str;
+ };
+
+ email = mkOption {
+ type = str;
+ };
+
+ key = mkOption {
+ type = nullOr str;
+ };
+
+ sign = mkOption {
+ type = bool;
+ default = true;
+ };
+ };
+
+ config = mkIf cfg.enable {
+ programs.git = {
+ enable = true;
+
+ userName = cfg.name;
+ userEmail = cfg.email;
+
+ signing = {
+ key = cfg.key;
+ signByDefault = cfg.sign;
+ };
+
+ ignores = [
+ "*~"
+ "*.swp"
+ ];
+ };
+ };
+}
+