about summary refs log tree commit diff stats
path: root/secrets/default.nix
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-07-29 21:58:49 +0200
committerSoispha <soispha@vhack.eu>2023-07-30 00:19:30 +0200
commit3f5e7b952916a9198afa6bcb85f9ad15187b0a80 (patch)
tree8029c515b900eb8453a629cc9424778f0cd03859 /secrets/default.nix
parentStyle(treewide): Remove some unused imports (diff)
downloadnixos-config-3f5e7b952916a9198afa6bcb85f9ad15187b0a80.tar.gz
nixos-config-3f5e7b952916a9198afa6bcb85f9ad15187b0a80.zip
Feat(treewide): Add enable options for secrets and impermanence
Diffstat (limited to '')
-rw-r--r--secrets/default.nix46
1 files changed, 26 insertions, 20 deletions
diff --git a/secrets/default.nix b/secrets/default.nix
index 1807fb8d..d1fc1714 100644
--- a/secrets/default.nix
+++ b/secrets/default.nix
@@ -1,25 +1,31 @@
-{config, ...}: let
+{
+  config,
+  lib,
+  ...
+}: let
   name = config.networking.hostName;
 in {
-  age = {
-    secrets = {
-      nheko = {
-        file = ./nheko/conf. + name;
-        mode = "700";
-        owner = "soispha";
-        group = "users";
-      };
-      serverphoneCa = {
-        file = ./serverphone/ca.key;
-        mode = "700";
-        owner = "serverphone";
-        group = "serverphone";
-      };
-      serverphoneServer = {
-        file = ./serverphone/server.key;
-        mode = "700";
-        owner = "serverphone";
-        group = "serverphone";
+  config = lib.mkIf config.soispha.secrets.enable {
+    age = {
+      secrets = {
+        nheko = {
+          file = ./nheko/conf. + name;
+          mode = "700";
+          owner = "soispha";
+          group = "users";
+        };
+        serverphoneCa = {
+          file = ./serverphone/ca.key;
+          mode = "700";
+          owner = "serverphone";
+          group = "serverphone";
+        };
+        serverphoneServer = {
+          file = ./serverphone/server.key;
+          mode = "700";
+          owner = "serverphone";
+          group = "serverphone";
+        };
       };
     };
   };