treewide: Fix using pkgs.{build,host}Platform alias

This was recently changed in nixpkgs to be an alias; if nixpkgs is
configured to disable aliases, this usage will fail.
This commit is contained in:
Andrew Marshall 2024-10-27 15:30:58 -04:00 committed by Felix Uhl
parent 0e55423bf8
commit 3979285062
4 changed files with 7 additions and 7 deletions

View file

@ -39,7 +39,7 @@
default = self.packages.${system}.disko; default = self.packages.${system}.disko;
create-release = pkgs.callPackage ./scripts/create-release.nix { }; create-release = pkgs.callPackage ./scripts/create-release.nix { };
} // pkgs.lib.optionalAttrs (!pkgs.buildPlatform.isRiscV64) { } // pkgs.lib.optionalAttrs (!pkgs.stdenv.buildPlatform.isRiscV64) {
disko-doc = pkgs.callPackage ./doc.nix { }; disko-doc = pkgs.callPackage ./doc.nix { };
}); });
# TODO: disable bios-related tests on aarch64... # TODO: disable bios-related tests on aarch64...
@ -48,7 +48,7 @@
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
# FIXME: aarch64-linux seems to hang on boot # FIXME: aarch64-linux seems to hang on boot
nixosTests = lib.optionalAttrs pkgs.hostPlatform.isx86_64 (import ./tests { nixosTests = lib.optionalAttrs pkgs.stdenv.hostPlatform.isx86_64 (import ./tests {
inherit pkgs; inherit pkgs;
makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix"); makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix");
eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix"); eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix");
@ -66,8 +66,8 @@
''; '';
in in
# FIXME: aarch64-linux seems to hang on boot # FIXME: aarch64-linux seems to hang on boot
lib.optionalAttrs pkgs.hostPlatform.isx86_64 (nixosTests // { inherit disko-install; }) // lib.optionalAttrs pkgs.stdenv.hostPlatform.isx86_64 (nixosTests // { inherit disko-install; }) //
pkgs.lib.optionalAttrs (!pkgs.buildPlatform.isRiscV64 && !pkgs.hostPlatform.isx86_32) { pkgs.lib.optionalAttrs (!pkgs.stdenv.buildPlatform.isRiscV64 && !pkgs.stdenv.hostPlatform.isx86_32) {
inherit shellcheck; inherit shellcheck;
inherit (self.packages.${system}) disko-doc; inherit (self.packages.${system}) disko-doc;
}); });

View file

@ -288,7 +288,7 @@ let
*/ */
writeCheckedBash = { pkgs, checked ? false, noDeps ? false }: pkgs.writers.makeScriptWriter { writeCheckedBash = { pkgs, checked ? false, noDeps ? false }: pkgs.writers.makeScriptWriter {
interpreter = if noDeps then "/usr/bin/env bash" else "${pkgs.bash}/bin/bash"; interpreter = if noDeps then "/usr/bin/env bash" else "${pkgs.bash}/bin/bash";
check = lib.optionalString (checked && !pkgs.hostPlatform.isRiscV64 && !pkgs.hostPlatform.isx86_32) (pkgs.writeScript "check" '' check = lib.optionalString (checked && !pkgs.stdenv.hostPlatform.isRiscV64 && !pkgs.stdenv.hostPlatform.isx86_32) (pkgs.writeScript "check" ''
set -efu set -efu
# SC2054: our toShellVars function doesn't quote list elements with commas # SC2054: our toShellVars function doesn't quote list elements with commas
# SC2034: We don't use all variables exported by hooks. # SC2034: We don't use all variables exported by hooks.

View file

@ -50,7 +50,7 @@ let
, bootCommands ? "" , bootCommands ? ""
, extraInstallerConfig ? { } , extraInstallerConfig ? { }
, extraSystemConfig ? { } , extraSystemConfig ? { }
, efi ? !pkgs.hostPlatform.isRiscV64 , efi ? !pkgs.stdenv.hostPlatform.isRiscV64
, postDisko ? "" , postDisko ? ""
, testMode ? "module" # can be one of direct module cli , testMode ? "module" # can be one of direct module cli
, testBoot ? true # if we actually want to test booting or just create/mount , testBoot ? true # if we actually want to test booting or just create/mount

View file

@ -12,7 +12,7 @@ let
(x: lib.hasSuffix ".nix" x && x != "default.nix") (x: lib.hasSuffix ".nix" x && x != "default.nix")
(lib.attrNames (builtins.readDir ./.)) (lib.attrNames (builtins.readDir ./.))
); );
incompatibleTests = lib.optionals pkgs.buildPlatform.isRiscV64 [ "zfs" "zfs-over-legacy" "cli" "module" "complex" ]; incompatibleTests = lib.optionals pkgs.stdenv.buildPlatform.isRiscV64 [ "zfs" "zfs-over-legacy" "cli" "module" "complex" ];
allCompatibleFilenames = lib.subtractLists incompatibleTests allTestFilenames; allCompatibleFilenames = lib.subtractLists incompatibleTests allTestFilenames;
allTests = lib.genAttrs allCompatibleFilenames (test: import (./. + "/${test}.nix") { inherit diskoLib pkgs; }); allTests = lib.genAttrs allCompatibleFilenames (test: import (./. + "/${test}.nix") { inherit diskoLib pkgs; });