diff options
author | David Arnold <dgx.arnold@gmail.com> | 2021-08-03 14:36:07 -0500 |
---|---|---|
committer | David Arnold <dgx.arnold@gmail.com> | 2021-08-03 15:05:52 -0500 |
commit | 2af2d3146d79866ae65ca1883527daa010669b07 (patch) | |
tree | a86ed30edaf8474e53b623277bd404be73737303 /nixos/modules/installer/netboot/netboot.nix | |
parent | 8ff76e34e075907aa700d44555090b7b45f37d44 (diff) |
nixos/boot-media: soft-force entire fs layout
https://github.com/NixOS/nixpkgs/pull/131760 was made to avo
a speicific configuration conflict that errored out for multiple definitions of "/" when the installer where overlayed
on any existing host configuration.
---
Problem 1: It turns out that in also other mountpoints can coflict.
Solution 1: use `mkOverride 60` for all mountpoints (even for the ones unlikely causing confilct for consistency sake)
---
Problem 2: It turns out that on an installation media for a fresh machine (before formatting), we usually don't have any devices yet formatted. However defining for example `fileSystems.<nme>.device = "/dev/disk/by-label/...", in newer versions of nixos, seems to make the system startup fail. Similarily waiting for a non-existent swap device does not make the startup fail, but has a 1:30 min timeout.
Solution 2: For an installation medium, soft-override ("unless users know what they are doing") the entire `fileSystems` and `swapDevices` definitions.
Diffstat (limited to 'nixos/modules/installer/netboot/netboot.nix')
-rw-r--r-- | nixos/modules/installer/netboot/netboot.nix | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/nixos/modules/installer/netboot/netboot.nix b/nixos/modules/installer/netboot/netboot.nix index f7543fdf4a23..adcaf9d1a335 100644 --- a/nixos/modules/installer/netboot/netboot.nix +++ b/nixos/modules/installer/netboot/netboot.nix @@ -29,31 +29,31 @@ with lib; then [] else [ pkgs.grub2 pkgs.syslinux ]); - fileSystems."/" = - # This module is often over-layed onto an existing host config - # that defines `/`. We use mkOverride 60 to override standard - # values, but at the same time leave room for mkForce values - # targeted at the image build. - { fsType = mkOverride 60 "tmpfs"; + # This module is often over-layed onto an existing host config + # that defines `fileSystems`. We use mkOverride 60 to override + # standard values, but at the same time leave room for mkForce + # values targeted at the image build. + fileSystems."/" = mkOverride 60 + { fsType = "tmpfs"; options = [ "mode=0755" ]; }; # In stage 1, mount a tmpfs on top of /nix/store (the squashfs # image) to make this a live CD. - fileSystems."/nix/.ro-store" = + fileSystems."/nix/.ro-store" = mkOverride 60 { fsType = "squashfs"; device = "../nix-store.squashfs"; options = [ "loop" ]; neededForBoot = true; }; - fileSystems."/nix/.rw-store" = + fileSystems."/nix/.rw-store" = mkOverride 60 { fsType = "tmpfs"; options = [ "mode=0755" ]; neededForBoot = true; }; - fileSystems."/nix/store" = + fileSystems."/nix/store" = mkOverride 60 { fsType = "overlay"; device = "overlay"; options = [ |