diff --git a/modules/module-list.nix b/modules/module-list.nix index f5296ccf9423..e2c9516ac463 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -23,7 +23,6 @@ ./hardware/network/rt73.nix ./hardware/network/rtl8192c.nix ./hardware/pcmcia.nix - ./installer/init-script/init-script.nix ./installer/tools/nixos-checkout.nix ./installer/tools/tools.nix ./misc/assertions.nix @@ -199,6 +198,7 @@ ./system/boot/loader/generations-dir/generations-dir.nix ./system/boot/loader/grub/grub.nix ./system/boot/loader/grub/memtest.nix + ./system/boot/loader/init-script/init-script.nix ./system/boot/luksroot.nix ./system/boot/modprobe.nix ./system/boot/stage-1.nix diff --git a/modules/system/activation/switch-to-configuration.sh b/modules/system/activation/switch-to-configuration.sh index fea0b05ef34f..285b095aa3ed 100644 --- a/modules/system/activation/switch-to-configuration.sh +++ b/modules/system/activation/switch-to-configuration.sh @@ -23,12 +23,7 @@ fi # Install or update the bootloader. if [ "$action" = "switch" -o "$action" = "boot" ]; then - @installBootLoader@ @out@ - - if [ -n "@initScriptBuilder@" ]; then - @initScriptBuilder@ @out@ - fi fi # Activate the new configuration. diff --git a/modules/system/activation/top-level.nix b/modules/system/activation/top-level.nix index 0e1a9a3d2adc..1eea759d8c99 100644 --- a/modules/system/activation/top-level.nix +++ b/modules/system/activation/top-level.nix @@ -152,7 +152,6 @@ let installBootLoader = config.system.build.installBootLoader or "echo 'Warning: don't know how to make this configuration bootable; please enable a boot loader.' 1>&2; true"; - initScriptBuilder = config.system.build.initScriptBuilder; activationScript = config.system.activationScripts.script; nixosVersion = config.system.nixosVersion; diff --git a/modules/installer/init-script/init-script-builder.sh b/modules/system/boot/loader/init-script/init-script-builder.sh similarity index 97% rename from modules/installer/init-script/init-script-builder.sh rename to modules/system/boot/loader/init-script/init-script-builder.sh index f091dc8b6c89..502b3b63af2f 100644 --- a/modules/installer/init-script/init-script-builder.sh +++ b/modules/system/boot/loader/init-script/init-script-builder.sh @@ -6,7 +6,7 @@ export PATH=/empty for i in @path@; do PATH=$PATH:$i/bin; done if test $# -ne 1; then - echo "Usage: grub-menu-builder.sh DEFAULT-CONFIG" + echo "Usage: init-script-builder.sh DEFAULT-CONFIG" exit 1 fi diff --git a/modules/installer/init-script/init-script.nix b/modules/system/boot/loader/init-script/init-script.nix similarity index 87% rename from modules/installer/init-script/init-script.nix rename to modules/system/boot/loader/init-script/init-script.nix index edf7d23d2a78..ef5e97eb2c9f 100644 --- a/modules/installer/init-script/init-script.nix +++ b/modules/system/boot/loader/init-script/init-script.nix @@ -41,10 +41,9 @@ in ###### implementation - config = { + config = mkIf config.boot.loader.initScript.enable { - system.build.initScriptBuilder = - if config.boot.loader.initScript.enable then initScriptBuilder else ""; + system.build.installBootLoader = initScriptBuilder; };