diff --git a/home/felschr-work.nix b/home/felschr-work.nix index b3aeebe..1ff2d6c 100644 --- a/home/felschr-work.nix +++ b/home/felschr-work.nix @@ -6,6 +6,7 @@ with pkgs; ./shell ./editors ./desktop + ./git.nix ./keybase.nix ./signal.nix ./chromium.nix @@ -34,19 +35,10 @@ with pkgs; programs.gpg.enable = true; - programs.git = { - enable = true; + programs.git.custom = { userName = "Felix Schroeter"; userEmail = "fs@upsquared.com"; - ignores = [".direnv"]; - signing = { - key = "6DA1 4A05 C6E0 7DBE EB81 BA24 28ED 46BC B881 7B7A"; - signByDefault = true; - }; - extraConfig = { - pull = { rebase = true; }; - rebase = { autoStash = true; }; - }; + signingKey = "6DA1 4A05 C6E0 7DBE EB81 BA24 28ED 46BC B881 7B7A"; }; programs.firefox.enable = true; diff --git a/home/felschr.nix b/home/felschr.nix index 6d8f804..6c0adab 100644 --- a/home/felschr.nix +++ b/home/felschr.nix @@ -6,6 +6,7 @@ with pkgs; ./shell ./editors ./desktop + ./git.nix ./keybase.nix ./signal.nix ./chromium.nix @@ -37,19 +38,10 @@ with pkgs; programs.gpg.enable = true; - programs.git = { - enable = true; + programs.git.custom = { userName = "Felix Tenley"; userEmail = "dev@felschr.com"; - ignores = [".direnv"]; - signing = { - key = "22A6 DD21 EE66 E73D D4B9 3F20 A12D 7C9D 2FD3 4458"; - signByDefault = true; - }; - extraConfig = { - pull = { rebase = true; }; - rebase = { autoStash = true; }; - }; + signingKey = "22A6 DD21 EE66 E73D D4B9 3F20 A12D 7C9D 2FD3 4458"; }; home.packages = with pkgs; [ diff --git a/home/git.nix b/home/git.nix new file mode 100644 index 0000000..97c0938 --- /dev/null +++ b/home/git.nix @@ -0,0 +1,38 @@ +{ lib, pkgs, config, ... }: + +with lib; +let + cfg = config.programs.git.custom; +in +{ + options.programs.git.custom = { + userName = mkOption { + type = types.str; + default = "Felix Tenley"; + }; + userEmail = mkOption { + type = types.str; + default = "dev@felschr.com"; + }; + signingKey = mkOption { + type = types.str; + }; + }; + + config = { + programs.git = { + enable = true; + userName = cfg.userName; + userEmail = cfg.userEmail; + ignores = [".direnv"]; + signing = { + key = cfg.signingKey; + signByDefault = true; + }; + extraConfig = { + pull = { rebase = true; }; + rebase = { autoStash = true; }; + }; + }; + }; +}