Add GPG-specific option

This commit is contained in:
Spotlight 2023-09-10 23:05:09 -05:00
parent 29a271d52f
commit 0e960995fb
Signed by: spotlight
GPG key ID: 874AA355B3209BDC
4 changed files with 40 additions and 26 deletions

View file

@ -43,11 +43,17 @@
# For all architecture variants of Darwin, we don't want only dotfiles.
aarch64-darwin.homeConfigurations.spot = homeManager {
system = "aarch64-darwin";
specialArgs.desktop = true;
specialArgs = {
desktop = true;
gpg = true;
};
};
x86_64-darwin.homeConfigurations.spot = homeManager {
system = "x86_64-darwin";
specialArgs.desktop = true;
specialArgs = {
desktop = true;
gpg = true;
};
};
};
};

View file

@ -48,21 +48,4 @@
yt-dlp
zola
];
# GPG
programs.gpg.enable = true;
home.file.".gnupg/gpg-agent.conf" = lib.mkIf pkgs.stdenv.isDarwin {
text = ''
pinentry-program "${pkgs.pinentry_mac}/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac"
'';
};
# password-store
programs.password-store = {
enable = true;
package = pkgs.pass.withExtensions (exts: [exts.pass-otp]);
settings = {
PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store";
};
};
}

28
home/gpg.nix Normal file
View file

@ -0,0 +1,28 @@
{ config, lib, pkgs, ... }:
{
# GPG
programs.gpg.enable = true;
home.file.".gnupg/gpg-agent.conf" = lib.mkIf pkgs.stdenv.isDarwin {
text = ''
pinentry-program "${pkgs.pinentry_mac}/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac"
'';
};
# password-store
programs.password-store = {
enable = true;
package = pkgs.pass.withExtensions (exts: [exts.pass-otp]);
settings = {
PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store";
};
};
# Only specify signing if GPG is otherwise being pulled in;
# i.e. in a prompt configuration.
programs.git.signing = {
key = "6EF6CBB6420B81DA3CCACFEA874AA355B3209BDC";
signByDefault = true;
};
}

View file

@ -2,6 +2,7 @@
let
desktop = specialArgs.desktop or false;
gpg = specialArgs.gpg or false;
in {
# It's standard convention that Darwin has the username
# "spot" - "spotlight" was reserved by the system at some point.
@ -23,12 +24,6 @@ in {
userName = "Spotlight";
userEmail = "spotlight@joscomputing.space";
# Only specify signing if GPG is otherwise being pulled in;
# i.e. in a prompt configuration.
signing = {
key = "6EF6CBB6420B81DA3CCACFEA874AA355B3209BDC";
signByDefault = true;
};
extraConfig = {
color.ui = "auto";
pull.rebase = true;
@ -45,7 +40,9 @@ in {
./prompt.nix
]
# Primarily GUI applications for desktop usage
++ (lib.optional (desktop) ./desktop.nix);
++ (lib.optional (desktop) ./desktop.nix)
# Configuration reliant on GPG keys being available
++ (lib.optional (gpg) ./desktop.nix);
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage