From fd15f37b37f4c371ce8723129db3d5fbe11454a7 Mon Sep 17 00:00:00 2001 From: Christian Kampka Date: Fri, 31 May 2019 23:27:35 +0200 Subject: [PATCH 1/3] Revert "extlinux-conf: fix cross compilation" This reverts commit f17dd04f12a6eccdf613968efca38cfd0edfd2c0. --- .../generic-extlinux-compatible/extlinux-conf-builder.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix index 9ac6b6b12242..576a07c1d272 100644 --- a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix +++ b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix @@ -3,6 +3,6 @@ pkgs.substituteAll { src = ./extlinux-conf-builder.sh; isExecutable = true; - path = [pkgs.buildPackages.coreutils pkgs.buildPackages.gnused pkgs.buildPackages.gnugrep]; - inherit (pkgs.buildPackages) bash; + path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; + inherit (pkgs) bash; } From 0d570e020e090c90701a52fac55ac3c6f3dbe1a2 Mon Sep 17 00:00:00 2001 From: Christian Kampka Date: Fri, 31 May 2019 21:51:29 +0200 Subject: [PATCH 2/3] Revert "treewide: use buildPackages for config builders" This reverts commit 35af6e36057cafbb30df684326803e9e54bb377e. --- nixos/modules/installer/cd-dvd/sd-image-aarch64.nix | 2 +- .../installer/cd-dvd/sd-image-armv7l-multiplatform.nix | 2 +- nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix | 2 +- .../system/boot/loader/generations-dir/generations-dir.nix | 4 ++-- .../boot/loader/generic-extlinux-compatible/default.nix | 2 +- .../modules/system/boot/loader/init-script/init-script.nix | 4 ++-- .../system/boot/loader/raspberrypi/uboot-builder.nix | 7 ++++--- .../system/boot/loader/systemd-boot/systemd-boot.nix | 2 +- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix b/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix index 5f7194e92a36..7d7477aaee7e 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix @@ -5,7 +5,7 @@ let extlinux-conf-builder = import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix { - pkgs = pkgs.buildPackages; + inherit pkgs; }; in { diff --git a/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix b/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix index 71448f74c361..282bc2b471cc 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix @@ -5,7 +5,7 @@ let extlinux-conf-builder = import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix { - pkgs = pkgs.buildPackages; + inherit pkgs; }; in { diff --git a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix index 96e06670694e..9beb43977440 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix @@ -5,7 +5,7 @@ let extlinux-conf-builder = import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix { - pkgs = pkgs.buildPackages; + inherit pkgs; }; in { diff --git a/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix b/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix index ff90a9b46179..2d27611946e2 100644 --- a/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix +++ b/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix @@ -7,8 +7,8 @@ let generationsDirBuilder = pkgs.substituteAll { src = ./generations-dir-builder.sh; isExecutable = true; - inherit (pkgs.buildPackages) bash; - path = with pkgs.buildPackages; [coreutils gnused gnugrep]; + inherit (pkgs) bash; + path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; inherit (config.boot.loader.generationsDir) copyKernels; }; diff --git a/nixos/modules/system/boot/loader/generic-extlinux-compatible/default.nix b/nixos/modules/system/boot/loader/generic-extlinux-compatible/default.nix index 5f5dbe1092d0..af39c7bb6841 100644 --- a/nixos/modules/system/boot/loader/generic-extlinux-compatible/default.nix +++ b/nixos/modules/system/boot/loader/generic-extlinux-compatible/default.nix @@ -8,7 +8,7 @@ let timeoutStr = if blCfg.timeout == null then "-1" else toString blCfg.timeout; - builder = import ./extlinux-conf-builder.nix { pkgs = pkgs.buildPackages; }; + builder = import ./extlinux-conf-builder.nix { inherit pkgs; }; in { options = { diff --git a/nixos/modules/system/boot/loader/init-script/init-script.nix b/nixos/modules/system/boot/loader/init-script/init-script.nix index 385a26036784..374d9524ff1e 100644 --- a/nixos/modules/system/boot/loader/init-script/init-script.nix +++ b/nixos/modules/system/boot/loader/init-script/init-script.nix @@ -7,8 +7,8 @@ let initScriptBuilder = pkgs.substituteAll { src = ./init-script-builder.sh; isExecutable = true; - inherit (pkgs.buildPackages) bash; - path = with pkgs.buildPackages; [coreutils gnused gnugrep]; + inherit (pkgs) bash; + path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; }; in diff --git a/nixos/modules/system/boot/loader/raspberrypi/uboot-builder.nix b/nixos/modules/system/boot/loader/raspberrypi/uboot-builder.nix index 94599a0081c6..9d4f8a93d282 100644 --- a/nixos/modules/system/boot/loader/raspberrypi/uboot-builder.nix +++ b/nixos/modules/system/boot/loader/raspberrypi/uboot-builder.nix @@ -18,17 +18,18 @@ let extlinuxConfBuilder = import ../generic-extlinux-compatible/extlinux-conf-builder.nix { - pkgs = pkgs.buildPackages; + inherit pkgs; }; in pkgs.substituteAll { src = ./uboot-builder.sh; isExecutable = true; - inherit (pkgs.buildPackages) bash; - path = with pkgs.buildPackages; [coreutils gnused gnugrep]; + inherit (pkgs) bash; + path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; firmware = pkgs.raspberrypifw; inherit uboot; inherit configTxt; inherit extlinuxConfBuilder; inherit version; } + diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix index ad464a456bcd..3e39dc5dd396 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix @@ -12,7 +12,7 @@ let isExecutable = true; - inherit (pkgs.buildPackages) python3; + inherit (pkgs) python3; systemd = config.systemd.package; From f2a894807856309a97c4559cc704eaaa24d7ee3f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Fri, 31 May 2019 21:52:38 +0200 Subject: [PATCH 3/3] treewide: use buildPackages for config builders Partially reapplies 35af6e36057cafbb30df684326803e9e54bb377e buildPackages need to be used only for image builders. Otherwise, the bootloader builder may be setup using the wrong arch, rendering it unusable --- nixos/modules/installer/cd-dvd/sd-image-aarch64.nix | 2 +- .../modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix | 2 +- nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix b/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix index 7d7477aaee7e..5f7194e92a36 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix @@ -5,7 +5,7 @@ let extlinux-conf-builder = import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix { - inherit pkgs; + pkgs = pkgs.buildPackages; }; in { diff --git a/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix b/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix index 282bc2b471cc..71448f74c361 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix @@ -5,7 +5,7 @@ let extlinux-conf-builder = import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix { - inherit pkgs; + pkgs = pkgs.buildPackages; }; in { diff --git a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix index 9beb43977440..96e06670694e 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix @@ -5,7 +5,7 @@ let extlinux-conf-builder = import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix { - inherit pkgs; + pkgs = pkgs.buildPackages; }; in {