Loading nixos/modules/tasks/filesystems/overlayfs.nix +23 −12 Original line number Diff line number Diff line Loading @@ -127,18 +127,29 @@ in boot.initrd.availableKernelModules = lib.mkIf (initrdFileSystems != { }) [ "overlay" ]; assertions = lib.concatLists (lib.mapAttrsToList (_name: fs: [ assertions = lib.concatLists ( lib.mapAttrsToList (_name: fs: [ { assertion = (fs.overlay.upperdir == null) == (fs.overlay.workdir == null); message = "You cannot define a `lowerdir` without a `workdir` and vice versa for mount point: ${fs.mountPoint}"; } { assertion = (fs.overlay.lowerdir != null && fs.overlay.upperdir == null) -> (lib.length fs.overlay.lowerdir) >= 2; assertion = (fs.overlay.lowerdir != null && fs.overlay.upperdir == null) -> (lib.length fs.overlay.lowerdir) >= 2; message = "A read-only overlay (without an `upperdir`) requires at least 2 `lowerdir`s: ${fs.mountPoint}"; } ]) config.fileSystems); ]) overlayFileSystems ) ++ lib.mapAttrsToList (_: fs: { assertion = fs.overlay.upperdir == null -> config.boot.initrd.systemd.enable; message = '' Stage 1 overlay file system ${fs.mountPoint} has no upperdir, which is not supported with scripted initrd. Please enable 'boot.initrd.systemd.enable'. ''; }) initrdFileSystems; boot.initrd.systemd.services = lib.mkMerge (lib.mapAttrsToList preMountService initrdFileSystems); systemd.services = lib.mkMerge (lib.mapAttrsToList preMountService userspaceFileSystems); Loading nixos/tests/filesystems-overlayfs.nix +0 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ in nodes.machine = { config, pkgs, ... }: { boot.initrd.systemd.enable = true; boot.initrd.availableKernelModules = [ "overlay" ]; virtualisation.fileSystems = { "/initrd-overlay" = { Loading Loading
nixos/modules/tasks/filesystems/overlayfs.nix +23 −12 Original line number Diff line number Diff line Loading @@ -127,18 +127,29 @@ in boot.initrd.availableKernelModules = lib.mkIf (initrdFileSystems != { }) [ "overlay" ]; assertions = lib.concatLists (lib.mapAttrsToList (_name: fs: [ assertions = lib.concatLists ( lib.mapAttrsToList (_name: fs: [ { assertion = (fs.overlay.upperdir == null) == (fs.overlay.workdir == null); message = "You cannot define a `lowerdir` without a `workdir` and vice versa for mount point: ${fs.mountPoint}"; } { assertion = (fs.overlay.lowerdir != null && fs.overlay.upperdir == null) -> (lib.length fs.overlay.lowerdir) >= 2; assertion = (fs.overlay.lowerdir != null && fs.overlay.upperdir == null) -> (lib.length fs.overlay.lowerdir) >= 2; message = "A read-only overlay (without an `upperdir`) requires at least 2 `lowerdir`s: ${fs.mountPoint}"; } ]) config.fileSystems); ]) overlayFileSystems ) ++ lib.mapAttrsToList (_: fs: { assertion = fs.overlay.upperdir == null -> config.boot.initrd.systemd.enable; message = '' Stage 1 overlay file system ${fs.mountPoint} has no upperdir, which is not supported with scripted initrd. Please enable 'boot.initrd.systemd.enable'. ''; }) initrdFileSystems; boot.initrd.systemd.services = lib.mkMerge (lib.mapAttrsToList preMountService initrdFileSystems); systemd.services = lib.mkMerge (lib.mapAttrsToList preMountService userspaceFileSystems); Loading
nixos/tests/filesystems-overlayfs.nix +0 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ in nodes.machine = { config, pkgs, ... }: { boot.initrd.systemd.enable = true; boot.initrd.availableKernelModules = [ "overlay" ]; virtualisation.fileSystems = { "/initrd-overlay" = { Loading