diff options
Diffstat (limited to 'system-profiles')
| -rw-r--r-- | system-profiles/nfsroot.nix | 11 | ||||
| -rw-r--r-- | system-profiles/tmpfs-root.nix | 12 |
2 files changed, 17 insertions, 6 deletions
diff --git a/system-profiles/nfsroot.nix b/system-profiles/nfsroot.nix index 92cf98de..ab028de3 100644 --- a/system-profiles/nfsroot.nix +++ b/system-profiles/nfsroot.nix | |||
| @@ -1,10 +1,14 @@ | |||
| 1 | { config, pkgs, lib, flakeInputs, ... }: | 1 | { config, pkgs, lib, flake, flakeInputs, ... }: |
| 2 | 2 | ||
| 3 | with lib; | 3 | with lib; |
| 4 | 4 | ||
| 5 | let | 5 | let |
| 6 | cfg = config.nfsroot; | 6 | cfg = config.nfsroot; |
| 7 | in { | 7 | in { |
| 8 | imports = with flake.nixosModules.systemProfiles; [ | ||
| 9 | tmpfs-root | ||
| 10 | ]; | ||
| 11 | |||
| 8 | options = { | 12 | options = { |
| 9 | nfsroot = { | 13 | nfsroot = { |
| 10 | storeDevice = mkOption { | 14 | storeDevice = mkOption { |
| @@ -34,11 +38,6 @@ in { | |||
| 34 | then [] | 38 | then [] |
| 35 | else [ pkgs.grub2 pkgs.syslinux ]); | 39 | else [ pkgs.grub2 pkgs.syslinux ]); |
| 36 | 40 | ||
| 37 | fileSystems."/" = mkImageMediaOverride | ||
| 38 | { fsType = "tmpfs"; | ||
| 39 | options = [ "mode=0755" ]; | ||
| 40 | }; | ||
| 41 | |||
| 42 | # In stage 1, mount a tmpfs on top of /nix/store (the squashfs | 41 | # In stage 1, mount a tmpfs on top of /nix/store (the squashfs |
| 43 | # image) to make this a live CD. | 42 | # image) to make this a live CD. |
| 44 | fileSystems."/nix/.ro-store" = mkImageMediaOverride | 43 | fileSystems."/nix/.ro-store" = mkImageMediaOverride |
diff --git a/system-profiles/tmpfs-root.nix b/system-profiles/tmpfs-root.nix new file mode 100644 index 00000000..d0b3be76 --- /dev/null +++ b/system-profiles/tmpfs-root.nix | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | { ... }: { | ||
| 2 | config = { | ||
| 3 | fileSystems."/" = { | ||
| 4 | fsType = "tmpfs"; | ||
| 5 | options = [ "mode=0755" ]; | ||
| 6 | }; | ||
| 7 | |||
| 8 | security.sudo.extraConfig = '' | ||
| 9 | Defaults lecture = never | ||
| 10 | ''; | ||
| 11 | }; | ||
| 12 | } | ||
