fix evaluation of checks on non-x86_64-linux

run nix fmt
This commit is contained in:
Jörg Thalheim committed 2023-09-02 18:37:01 +02:00
1 parent 9de99e174c
commit c4f2de908d
3 files changed
+8 -5

No files matched your search

+6 -3
View File
@@ -37,18 +37,21 @@
checks = forAllSystems (system: checks = forAllSystems (system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
nixosTests = import ./tests { # FIXME: aarch64-linux seems to hang on boot
nixosTests = nixpkgs.lib.optionalAttrs pkgs.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");
}; });
shellcheck = pkgs.runCommand "shellcheck" { nativeBuildInputs = [ pkgs.shellcheck ]; } '' shellcheck = pkgs.runCommand "shellcheck" { nativeBuildInputs = [ pkgs.shellcheck ]; } ''
cd ${./.} cd ${./.}
shellcheck disk-deactivate/disk-deactivate disko shellcheck disk-deactivate/disk-deactivate disko
touch $out touch $out
''; '';
in in
nixosTests // pkgs.lib.optionalAttrs (!pkgs.buildPlatform.isRiscV64) { inherit shellcheck; }); # FIXME: aarch64-linux seems to hang on boot
nixpkgs.lib.optionalAttrs pkgs.hostPlatform.isx86_64 nixosTests //
pkgs.lib.optionalAttrs (!pkgs.buildPlatform.isRiscV64 && !pkgs.hostPlatform.isx86_32) { inherit shellcheck; });
formatter = forAllSystems (system: formatter = forAllSystems (system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
+1 -1
View File
@@ -253,7 +253,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.writeScript "check" '' check = lib.optionalString (checked && !pkgs.hostPlatform.isRiscV64 && !pkgs.hostPlatform.isx86_32) (pkgs.writeScript "check" ''
set -efu set -efu
${pkgs.shellcheck}/bin/shellcheck -e SC2034 "$1" ${pkgs.shellcheck}/bin/shellcheck -e SC2034 "$1"
''); '');
+1 -1
View File
@@ -10,6 +10,6 @@ diskoLib.makeDiskImageScript {
system.stateVersion = config.system.nixos.version; system.stateVersion = config.system.nixos.version;
}) })
]; ];
checked = !pkgs.hostPlatform.isRiscV64; checked = true;
} }