diff --git a/modules/cli/git.nix b/modules/cli/git.nix index 8c2bf2b..3f0a418 100644 --- a/modules/cli/git.nix +++ b/modules/cli/git.nix @@ -10,15 +10,18 @@ in { options.myOptions.programs.git = { enable = mkEnableOption "git"; userName = mkOption { - type = types.str; + type = with types; nullOr str; + default = null; description = "git username"; }; userEmail = mkOption { - type = types.str; + type = with types; nullOr str; + default = null; description = "git email"; }; signingKey = mkOption { - type = types.str; + type = with types; nullOr str; + default = null; description = "git commit signing key"; }; editor = mkOption { @@ -46,10 +49,10 @@ in { push.autoSetupRemote = true; commit = { verbose = true; - gpgsign = true; + gpgsign = cfg.signingKey != null; }; gpg.format = "ssh"; - user.signingkey = "key::${cfg.signingKey}"; + user.signingkey = mkIf (cfg.signingKey != null) "key::${cfg.signingKey}"; merge.conflictstyle = "zdiff3"; interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only"; diff.algorithm = "histogram";