fix evaluation of checks on non-x86_64-linux

run nix fmt
This commit is contained in:
Jörg Thalheim 2023-09-02 16:52:58 +02:00
parent 9de99e174c
commit c4f2de908d
3 changed files with 8 additions and 5 deletions

View file

@ -37,18 +37,21 @@
checks = forAllSystems (system:
let
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;
makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix");
eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix");
};
});
shellcheck = pkgs.runCommand "shellcheck" { nativeBuildInputs = [ pkgs.shellcheck ]; } ''
cd ${./.}
shellcheck disk-deactivate/disk-deactivate disko
touch $out
'';
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:
let
pkgs = nixpkgs.legacyPackages.${system};

View file

@ -253,7 +253,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.writeScript "check" ''
check = lib.optionalString (checked && !pkgs.hostPlatform.isRiscV64 && !pkgs.hostPlatform.isx86_32) (pkgs.writeScript "check" ''
set -efu
${pkgs.shellcheck}/bin/shellcheck -e SC2034 "$1"
'');

View file

@ -10,6 +10,6 @@ diskoLib.makeDiskImageScript {
system.stateVersion = config.system.nixos.version;
})
];
checked = !pkgs.hostPlatform.isRiscV64;
checked = true;
}