about summary refs log tree commit diff stats
path: root/home-manager/config/gpg/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/config/gpg/default.nix')
-rw-r--r--home-manager/config/gpg/default.nix40
1 files changed, 28 insertions, 12 deletions
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 <soispha@vhack.eu>";
       # 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;
   };
 }