diff --git a/modules/default.nix b/modules/default.nix index 60ee5637..ce462dd2 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -10,6 +10,7 @@ ./image.nix ./persist ./ports.nix + ./root-on-tmpfs.nix ./services ./sops.nix ./ssh.nix diff --git a/modules/persist/default.nix b/modules/persist/default.nix index 16d6c0a4..4d4211c8 100644 --- a/modules/persist/default.nix +++ b/modules/persist/default.nix @@ -183,11 +183,6 @@ in default = false; type = types.bool; }; - sane.persist.root-on-tmpfs = mkOption { - default = false; - type = types.bool; - description = "define / fs root to be a tmpfs. make sure to mount some other device to /nix"; - }; sane.persist.sys = mkOption { description = "directories (or files) to persist to disk, relative to the fs root /"; default = {}; @@ -203,7 +198,6 @@ in }; imports = [ - ./root-on-tmpfs.nix ./stores ]; diff --git a/modules/persist/root-on-tmpfs.nix b/modules/persist/root-on-tmpfs.nix deleted file mode 100644 index 5fd97622..00000000 --- a/modules/persist/root-on-tmpfs.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, lib, ... }: - -let - cfg = config.sane.persist; -in -{ - fileSystems."/" = lib.mkIf (cfg.enable && cfg.root-on-tmpfs) { - device = "none"; - fsType = "tmpfs"; - options = [ - "mode=755" - "size=1G" - "defaults" - ]; - }; -} diff --git a/modules/root-on-tmpfs.nix b/modules/root-on-tmpfs.nix new file mode 100644 index 00000000..3254ec25 --- /dev/null +++ b/modules/root-on-tmpfs.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: +{ + options = with lib; { + sane.root-on-tmpfs = mkOption { + default = false; + type = types.bool; + description = "define / fs root to be a tmpfs. make sure to mount some other device to /nix"; + }; + }; + + config = lib.mkIf config.sane.root-on-tmpfs { + fileSystems."/" = { + device = "none"; + fsType = "tmpfs"; + options = [ + "mode=755" + "size=1G" + "defaults" + ]; + }; + }; +}