Add your signing key as the GPG default and trusted key list
This commit is contained in:
parent
006713adc7
commit
78c85b1590
|
|
@ -115,6 +115,7 @@
|
|||
homeConfigurations.josh = let
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
gpgSigningKey = null;
|
||||
in home-manager.lib.homeManagerConfiguration {
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
|
|
@ -123,6 +124,9 @@
|
|||
};
|
||||
pkgs = pkgs;
|
||||
modules = [
|
||||
{
|
||||
modules.gpg.signingKey = gpgSigningKey;
|
||||
}
|
||||
./homes/josh/home.nix
|
||||
stylix.homeModules.stylix
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
{
|
||||
config,
|
||||
gpgSigningKey,
|
||||
lib,
|
||||
pkgs,
|
||||
profile,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let gpgCfg = config.modules.gpg;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../modules/homes
|
||||
|
|
@ -34,7 +35,7 @@ with lib;
|
|||
name = "Joshua Yuen";
|
||||
email = "joshuayuen99@gmail.com";
|
||||
# We need to do this to pass through the (optional) signing key from the hosts/* file
|
||||
signingkey = if gpgSigningKey != "" then gpgSigningKey else config.modules.gpg.signingKey;
|
||||
signingkey = mkIf (gpgCfg.signingKey != null) gpgCfg.signingKey;
|
||||
};
|
||||
commit.gpgsign = true;
|
||||
init.defaultBranch = "main";
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ in
|
|||
profile
|
||||
username
|
||||
;
|
||||
gpgSigningKey = config.modules.gpg.signingKey;
|
||||
};
|
||||
users.${username} = {
|
||||
imports = [ ../../homes/${username}/home.nix ];
|
||||
modules.gpg.signingKey = config.modules.gpg.signingKey;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ in
|
|||
programs = {
|
||||
gpg = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
default-key = mkIf (cfg.signingKey != null) cfg.signingKey;
|
||||
trusted-key = mkIf (cfg.signingKey != null) cfg.signingKey;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ with lib;
|
|||
};
|
||||
|
||||
signingKey = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "The key ID to sign with for git";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue