Add GPG config for git signing
This commit is contained in:
parent
f5e578c184
commit
50b6262b06
|
|
@ -58,7 +58,6 @@
|
||||||
host = "laptop";
|
host = "laptop";
|
||||||
profile = "desktop";
|
profile = "desktop";
|
||||||
username = "josh";
|
username = "josh";
|
||||||
gpgSigningKey = "0x530DA0331EFE99F5";
|
|
||||||
in nixpkgs.lib.nixosSystem {
|
in nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
|
@ -66,7 +65,6 @@
|
||||||
inherit host;
|
inherit host;
|
||||||
inherit profile;
|
inherit profile;
|
||||||
inherit username;
|
inherit username;
|
||||||
inherit gpgSigningKey;
|
|
||||||
};
|
};
|
||||||
pkgs = pkgs;
|
pkgs = pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
@ -103,7 +101,6 @@
|
||||||
inherit host;
|
inherit host;
|
||||||
inherit profile;
|
inherit profile;
|
||||||
inherit username;
|
inherit username;
|
||||||
|
|
||||||
};
|
};
|
||||||
pkgs = pkgs;
|
pkgs = pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
gpgSigningKey,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
profile,
|
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
|
# Let Home Manager install and manage itself
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,6 @@
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./host-packages.nix
|
./host-packages.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
modules.gpg.signingKey = "0x530DA0331EFE99F5";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ in
|
||||||
profile
|
profile
|
||||||
username
|
username
|
||||||
;
|
;
|
||||||
|
gpgSigningKey = config.modules.gpg.signingKey;
|
||||||
};
|
};
|
||||||
users.${username} = {
|
users.${username} = {
|
||||||
imports = [ ../../homes/${username}/home.nix ];
|
imports = [ ../../homes/${username}/home.nix ];
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./firefox.nix
|
./firefox.nix
|
||||||
|
./gpg.nix
|
||||||
./fzf.nix
|
./fzf.nix
|
||||||
./hyprland
|
./hyprland
|
||||||
./kitty.nix
|
./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 = [
|
imports = [
|
||||||
./displayManager.nix
|
./displayManager.nix
|
||||||
|
./gpg.nix
|
||||||
./hyprland.nix
|
./hyprland.nix
|
||||||
./localsend.nix
|
./localsend.nix
|
||||||
./pipewire.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