about summary refs log tree commit diff stats
path: root/system/impermanence
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--system/impermanence/default.nix34
1 files changed, 24 insertions, 10 deletions
diff --git a/system/impermanence/default.nix b/system/impermanence/default.nix
index 8e6d81fb..adbdfce2 100644
--- a/system/impermanence/default.nix
+++ b/system/impermanence/default.nix
@@ -1,4 +1,9 @@
-{config, ...}: let
+{
+  config,
+  lib,
+  ...
+}: let
+  cfg = config.soispha.impermanence;
   networkmanager =
     if config.networking.networkmanager.enable
     then [
@@ -23,16 +28,25 @@
     ++ networkmanager
     ++ secureboot;
 in {
-  # needed for the hm impermanence config
-  programs.fuse.userAllowOther = true;
+  options.soispha.impermanence = {
+    enable = lib.mkOption {
+      type = lib.types.bool;
+      default = true;
+      description = lib.mdDoc "Disk setup with disko";
+    };
+  };
+  config = lib.mkIf cfg.enable {
+    # needed for the hm impermanence config
+    programs.fuse.userAllowOther = true;
 
-  environment.persistence = {
-    "/srv" = {
-      hideMounts = true;
-      inherit directories;
-      files = [
-        "/etc/machine-id"
-      ];
+    environment.persistence = {
+      "/srv" = {
+        hideMounts = true;
+        inherit directories;
+        files = [
+          "/etc/machine-id"
+        ];
+      };
     };
   };
 }