diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-08-08 05:11:59 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-08-08 05:11:59 -0600 |
| commit | 45d079d445bb3d6c2df4e3c99349677eed78010b (patch) | |
| tree | 722a9c2a17a478467c30e9b5f3f98b588a5398e7 /sys | |
| parent | f74c0f26e887467f1edd3bda5f03da3786180eb3 (diff) | |
sys: implement primitive impermanence
Diffstat (limited to '')
| -rw-r--r-- | sys/default.nix | 4 | ||||
| -rw-r--r-- | sys/fs/default.nix | 21 |
2 files changed, 20 insertions, 5 deletions
diff --git a/sys/default.nix b/sys/default.nix index 215361e..ad99009 100644 --- a/sys/default.nix +++ b/sys/default.nix @@ -1,8 +1,10 @@ -{ self }: +{ self, impermanence }: { lib, config, pkgs, modulesPath, ... }: { imports = [ "${modulesPath}/installer/scan/not-detected.nix" + impermanence.nixosModule + ./auth.nix ./boot.nix ./fs diff --git a/sys/fs/default.nix b/sys/fs/default.nix index 9f2f646..d24e357 100644 --- a/sys/fs/default.nix +++ b/sys/fs/default.nix @@ -1,19 +1,32 @@ { lib, config, ... }: with lib; let - cfg = config.local; + cfg = config.local.fs; in { imports = [ ./btrfs.nix ./layout.nix ]; - options.local.fs.boot.device = with lib.types; mkOption { - type = str; + options.local.fs = with lib.types; { + impermanence = mkOption { + type = bool; + default = false; + }; + + boot.device = mkOption { + type = str; + }; }; config = { # !!! boot.tmpOnTmpfs = true; + fileSystems."/" = mkIf cfg.impermanence { + device = "tmpfs"; + fsType = "tmpfs"; + options = [ "size=1G" "mode=755" ]; + }; + fileSystems."/boot" = { - inherit (cfg.fs.boot) device; + inherit (cfg.boot) device; fsType = "vfat"; options = [ "noatime" "umask=027" ]; }; |
