12 useHostResolvConf = config.networking.resolvconf.enable && config.networking.useHostResolvConf;
14 bootStage2 = pkgs.substituteAll {
15 src = ./stage-2-init.sh;
16 shellDebug = "${pkgs.bashInteractive}/bin/bash";
17 shell = "${pkgs.bash}/bin/bash";
18 inherit (config.boot) readOnlyNixStore systemdExecutable extraSystemdUnitPaths;
19 inherit (config.system.nixos) distroName;
21 inherit useHostResolvConf;
22 inherit (config.system.build) earlyMountScript;
23 path = lib.makeBinPath (
28 ++ lib.optional useHostResolvConf pkgs.openresolv
30 postBootCommands = pkgs.writeText "local-cmds" ''
31 ${config.boot.postBootCommands}
32 ${config.powerManagement.powerUpCommands}
43 postBootCommands = mkOption {
45 example = "rm -f /var/log/messages";
48 Shell commands to be executed just before systemd is started.
52 readOnlyNixStore = mkOption {
56 If set, NixOS will enforce the immutability of the Nix store
57 by making {file}`/nix/store` a read-only bind
58 mount. Nix will automatically make the store writable when
63 systemdExecutable = mkOption {
64 default = "/run/current-system/systemd/lib/systemd/systemd";
67 The program to execute to start systemd.
71 extraSystemdUnitPaths = mkOption {
73 type = types.listOf types.str;
75 Additional paths that get appended to the SYSTEMD_UNIT_PATH environment variable
76 that can contain mutable unit files.
85 system.build.bootStage2 = bootStage2;