1 { config, lib, pkgs, ... }:
7 useHostResolvConf = config.networking.resolvconf.enable && config.networking.useHostResolvConf;
9 bootStage2 = pkgs.substituteAll {
10 src = ./stage-2-init.sh;
11 shellDebug = "${pkgs.bashInteractive}/bin/bash";
12 shell = "${pkgs.bash}/bin/bash";
13 inherit (config.boot) readOnlyNixStore systemdExecutable extraSystemdUnitPaths;
14 inherit (config.system.nixos) distroName;
16 inherit useHostResolvConf;
17 inherit (config.system.build) earlyMountScript;
18 path = lib.makeBinPath ([
21 ] ++ lib.optional useHostResolvConf pkgs.openresolv);
22 postBootCommands = pkgs.writeText "local-cmds"
24 ${config.boot.postBootCommands}
25 ${config.powerManagement.powerUpCommands}
36 postBootCommands = mkOption {
38 example = "rm -f /var/log/messages";
41 Shell commands to be executed just before systemd is started.
45 readOnlyNixStore = mkOption {
49 If set, NixOS will enforce the immutability of the Nix store
50 by making {file}`/nix/store` a read-only bind
51 mount. Nix will automatically make the store writable when
56 systemdExecutable = mkOption {
57 default = "/run/current-system/systemd/lib/systemd/systemd";
60 The program to execute to start systemd.
64 extraSystemdUnitPaths = mkOption {
66 type = types.listOf types.str;
68 Additional paths that get appended to the SYSTEMD_UNIT_PATH environment variable
69 that can contain mutable unit files.
79 system.build.bootStage2 = bootStage2;