Refactor git ssh signing

This commit is contained in:
Nathan McCarty 2023-04-26 01:24:42 -04:00
parent 3df790a53c
commit 7d45b0584a
No known key found for this signature in database
4 changed files with 19 additions and 19 deletions

View File

@ -74,6 +74,16 @@ with lib; {
signByDefault = lib.mkDefault config.nathan.programs.util.git.gpgSign; signByDefault = lib.mkDefault config.nathan.programs.util.git.gpgSign;
}; };
}) })
(mkIf (config.nathan.programs.util.git.enable
&& config.nathan.programs.util.git.sshSign) {
programs.git = {
extraConfig = {
commit.gpgsign = true;
gpg.format = "ssh";
user.signingkey = "~/.ssh/id_ed25519.pub";
};
};
})
(mkIf config.nathan.programs.util.git.enable { (mkIf config.nathan.programs.util.git.enable {
# Git adjacent packages # Git adjacent packages
home.packages = [ home.packages = [

View File

@ -22,6 +22,7 @@ with nLib; {
enable = mkEnableOptionT "git"; enable = mkEnableOptionT "git";
gpgSign = gpgSign =
mkDefaultOption "git signatures" config.nathan.config.isDesktop; mkDefaultOption "git signatures" config.nathan.config.isDesktop;
sshSign = mkDefaultOption "git ssh signatures" false;
}; };
# Bat configuration, enabled by default # Bat configuration, enabled by default
bat = mkEnableOptionT "bat"; bat = mkEnableOptionT "bat";

View File

@ -7,7 +7,10 @@
programs = { programs = {
media.enable = false; media.enable = false;
util = { wine = true; }; util = { wine = true; };
git = { gpgSign = false; }; git = {
gpgSign = false;
sshSign = true;
};
# games = { launcher = true; }; # games = { launcher = true; };
# media.nicotineService = true; # media.nicotineService = true;
}; };
@ -60,13 +63,4 @@
# Lock mako notifs to main display # Lock mako notifs to main display
output = "Virtual-1"; output = "Virtual-1";
}; };
# Setup git commit signing with ssh key
programs.git = {
extraConfig = {
commit.gpgsign = true;
gpg.format = "ssh";
user.signingkey = "~/.ssh/id_ed25519.pub";
};
};
} }

View File

@ -9,7 +9,10 @@
}; };
}; };
programs = { programs = {
util = { productivity = true; }; util = {
productivity = true;
git.sshSign = true;
};
devel = { devel = {
core = true; core = true;
rust = true; rust = true;
@ -22,12 +25,4 @@
}; };
}; };
}; };
# Setup git commit signing with ssh key
programs.git = {
extraConfig = {
commit.gpgsign = true;
gpg.format = "ssh";
user.signingkey = "~/.ssh/id_ed25519.pub";
};
};
} }