Commit 15a7c49613af

Vincent Demeester <vincent@sbr.pm>
2019-01-04 10:26:13
desktop: split gpg to a new profiles…
… and enable it on hokkaido. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 6fe47a5
Changed files (4)
machines/hokkaido.nix
@@ -6,6 +6,7 @@
   profiles.dev = {
     go.enable = true;
   };
+  profiles.gpg.enable = true;
   profiles.containers.enable = true;
   profiles.media.enable = true;
 }
modules/profiles/desktop.nix
@@ -28,6 +28,7 @@ in
     };
   };
   config = mkIf cfg.enable {
+    profiles.gpg.enable = true;
     xsession = mkIf cfg.xsession.enable {
       enable = true;
       initExtra = ''
@@ -62,11 +63,6 @@ in
         longitude = "7.5";
         tray = true;
       };
-      gpg-agent = {
-        enable = true;
-        enableSshSupport = true;
-        defaultCacheTtlSsh = 7200;
-      };
     };
     home.file.".XCompose".source = ./assets/xorg/XCompose;
     home.file.".Xmodmap".source = ./assets/xorg/Xmodmap;
modules/profiles/gpg.nix
@@ -0,0 +1,26 @@
+{ config, lib, ... }:
+
+with lib;
+let
+  cfg = config.profiles.gpg;
+in
+{
+  options = {
+    profiles.gpg = {
+      enable = mkOption {
+        default = true;
+        description = "Enable gpg profile and configuration";
+        type = types.bool;
+      };
+    };
+  };
+  config = mkIf cfg.enable {
+    services = {
+      gpg-agent = {
+        enable = true;
+        enableSshSupport = true;
+        defaultCacheTtlSsh = 7200;
+      };
+    };
+  };
+}
modules/module-list.nix
@@ -16,6 +16,7 @@
     ./profiles/gaming.nix
     ./profiles/gcloud.nix
     ./profiles/git.nix
+    ./profiles/gpg.nix
     ./profiles/i3.nix
     ./profiles/kubernetes.nix
     ./profiles/laptop.nix