Add GPG config for git signing
This commit is contained in:
parent
f5e578c184
commit
50b6262b06
|
|
@ -58,7 +58,6 @@
|
|||
host = "laptop";
|
||||
profile = "desktop";
|
||||
username = "josh";
|
||||
gpgSigningKey = "0x530DA0331EFE99F5";
|
||||
in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
|
|
@ -66,7 +65,6 @@
|
|||
inherit host;
|
||||
inherit profile;
|
||||
inherit username;
|
||||
inherit gpgSigningKey;
|
||||
};
|
||||
pkgs = pkgs;
|
||||
modules = [
|
||||
|
|
@ -103,7 +101,6 @@
|
|||
inherit host;
|
||||
inherit profile;
|
||||
inherit username;
|
||||
|
||||
};
|
||||
pkgs = pkgs;
|
||||
modules = [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
config,
|
||||
gpgSigningKey,
|
||||
lib,
|
||||
pkgs,
|
||||
profile,
|
||||
|
|
@ -25,6 +27,23 @@ with lib;
|
|||
];
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user = {
|
||||
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;
|
||||
};
|
||||
commit.gpgsign = true;
|
||||
init.defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
|
||||
# Enable GPG-agent for git signing
|
||||
modules.gpg.enable = true;
|
||||
|
||||
# Let Home Manager install and manage itself
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,4 +12,6 @@
|
|||
./hardware.nix
|
||||
./host-packages.nix
|
||||
];
|
||||
|
||||
modules.gpg.signingKey = "0x530DA0331EFE99F5";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ in
|
|||
profile
|
||||
username
|
||||
;
|
||||
gpgSigningKey = config.modules.gpg.signingKey;
|
||||
};
|
||||
users.${username} = {
|
||||
imports = [ ../../homes/${username}/home.nix ];
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
imports = [
|
||||
./direnv.nix
|
||||
./firefox.nix
|
||||
./gpg.nix
|
||||
./fzf.nix
|
||||
./hyprland
|
||||
./kitty.nix
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.gpg;
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
services = {
|
||||
gpg-agent = {
|
||||
enable = true;
|
||||
enableSshSupport = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
pinentry.package = pkgs.pinentry-qt;
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [ pkgs.gnupg ];
|
||||
|
||||
programs = {
|
||||
gpg = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
{
|
||||
imports = [
|
||||
./displayManager.nix
|
||||
./gpg.nix
|
||||
./hyprland.nix
|
||||
./localsend.nix
|
||||
./pipewire.nix
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
{
|
||||
options.modules.gpg = {
|
||||
enable = mkEnableOption {
|
||||
default = false;
|
||||
description = "Enable gpg-agent";
|
||||
};
|
||||
|
||||
signingKey = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = "The key ID to sign with for git";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Reference in New Issue