make some git options nullable to make things work

This commit is contained in:
jacekpoz 2024-05-03 18:54:03 +02:00
parent 4b14003286
commit 5b89920a90
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -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";