summaryrefslogtreecommitdiffstats
path: root/nixos/modules/system/boot/stage-2.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/system/boot/stage-2.nix')
-rw-r--r--nixos/modules/system/boot/stage-2.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/stage-2.nix b/nixos/modules/system/boot/stage-2.nix
index 6b4193ea2967..6ed915c339e0 100644
--- a/nixos/modules/system/boot/stage-2.nix
+++ b/nixos/modules/system/boot/stage-2.nix
@@ -10,9 +10,8 @@ let
src = ./stage-2-init.sh;
shellDebug = "${pkgs.bashInteractive}/bin/bash";
shell = "${pkgs.bash}/bin/bash";
- inherit (config.boot) systemdExecutable extraSystemdUnitPaths;
+ inherit (config.boot) readOnlyNixStore systemdExecutable extraSystemdUnitPaths;
isExecutable = true;
- inherit (config.nix) readOnlyStore;
inherit useHostResolvConf;
inherit (config.system.build) earlyMountScript;
path = lib.makeBinPath ([
@@ -42,6 +41,17 @@ in
'';
};
+ readOnlyNixStore = mkOption {
+ type = types.bool;
+ default = true;
+ description = lib.mdDoc ''
+ If set, NixOS will enforce the immutability of the Nix store
+ by making {file}`/nix/store` a read-only bind
+ mount. Nix will automatically make the store writable when
+ needed.
+ '';
+ };
+
systemdExecutable = mkOption {
default = "/run/current-system/systemd/lib/systemd/systemd";
type = types.str;