From 3979285062d6781525cded0f6c4ff92e71376b55 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sun, 27 Oct 2024 15:30:58 -0400 Subject: [PATCH] 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. --- flake.nix | 8 ++++---- lib/default.nix | 2 +- lib/tests.nix | 2 +- tests/default.nix | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index ae51fc59..501218b6 100644 --- a/flake.nix +++ b/flake.nix @@ -39,7 +39,7 @@ default = self.packages.${system}.disko; 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 { }; }); # TODO: disable bios-related tests on aarch64... @@ -48,7 +48,7 @@ let pkgs = nixpkgs.legacyPackages.${system}; # 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; makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix"); eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix"); @@ -66,8 +66,8 @@ ''; in # FIXME: aarch64-linux seems to hang on boot - lib.optionalAttrs pkgs.hostPlatform.isx86_64 (nixosTests // { inherit disko-install; }) // - pkgs.lib.optionalAttrs (!pkgs.buildPlatform.isRiscV64 && !pkgs.hostPlatform.isx86_32) { + lib.optionalAttrs pkgs.stdenv.hostPlatform.isx86_64 (nixosTests // { inherit disko-install; }) // + pkgs.lib.optionalAttrs (!pkgs.stdenv.buildPlatform.isRiscV64 && !pkgs.stdenv.hostPlatform.isx86_32) { inherit shellcheck; inherit (self.packages.${system}) disko-doc; }); diff --git a/lib/default.nix b/lib/default.nix index d19acac6..7cd6ef99 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -288,7 +288,7 @@ let */ writeCheckedBash = { pkgs, checked ? false, noDeps ? false }: pkgs.writers.makeScriptWriter { 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 # SC2054: our toShellVars function doesn't quote list elements with commas # SC2034: We don't use all variables exported by hooks. diff --git a/lib/tests.nix b/lib/tests.nix index 0aff4207..fd24a807 100644 --- a/lib/tests.nix +++ b/lib/tests.nix @@ -50,7 +50,7 @@ let , bootCommands ? "" , extraInstallerConfig ? { } , extraSystemConfig ? { } - , efi ? !pkgs.hostPlatform.isRiscV64 + , efi ? !pkgs.stdenv.hostPlatform.isRiscV64 , postDisko ? "" , testMode ? "module" # can be one of direct module cli , testBoot ? true # if we actually want to test booting or just create/mount diff --git a/tests/default.nix b/tests/default.nix index cb9d47d3..1ea3143a 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -12,7 +12,7 @@ let (x: lib.hasSuffix ".nix" x && x != "default.nix") (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; allTests = lib.genAttrs allCompatibleFilenames (test: import (./. + "/${test}.nix") { inherit diskoLib pkgs; });