From 918ba5d027c38be355bd40b56407201a8adc0eaa Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 29 Jul 2023 15:03:33 +0200 Subject: Fix(hm/conf/gpg): Add config for isimud --- home-manager/config/gpg/default.nix | 40 ++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'home-manager/config/gpg') diff --git a/home-manager/config/gpg/default.nix b/home-manager/config/gpg/default.nix index 669f7ea1..9e11b04d 100644 --- a/home-manager/config/gpg/default.nix +++ b/home-manager/config/gpg/default.nix @@ -1,5 +1,6 @@ { config, + nixosConfig, sysLib, pkgs, ... @@ -12,19 +13,37 @@ onlykey-agent ]; }; -in { - programs.gpg = { - enable = true; - homedir = "${config.xdg.dataHome}/gnupg/onlykey"; - mutableKeys = true; - mutableTrust = true; - settings = { + settings = + if nixosConfig.networking.hostName == "isimud" + then {} + else { # Hardware-based GPG configuration agent-program = "${agent-program}/bin/onlykey-gpg-agent"; default-key = "Soispha "; # TODO add more }; + gpg-agent = + if nixosConfig.networking.hostName == "isimud" + then { + enable = true; + enableZshIntegration = true; + enableScDaemon = true; # smartcards and such things + pinentryFlavor = "tty"; + } + else { + enable = false; + enableZshIntegration = true; + enableScDaemon = true; # smartcards and such things + pinentryFlavor = "tty"; + }; +in { + programs.gpg = { + enable = true; + homedir = "${config.xdg.dataHome}/gnupg/onlykey"; + mutableKeys = true; + mutableTrust = true; + inherit settings; publicKeys = [ { source = ./keys/sils_at_sils.li; @@ -36,10 +55,7 @@ in { } ]; }; - services.gpg-agent = { - enable = false; - enableZshIntegration = true; - enableScDaemon = true; # smartcards and such things - pinentryFlavor = "tty"; + services = { + inherit gpg-agent; }; } -- cgit 1.4.1