mirror of
https://github.com/nix-community/disko.git
synced 2026-12-04 15:03:28 +01:00
Merge pull request #342 from nix-community/platform-fixes
disable shellcheck for x86_32 and riscv64 in one place
This commit is contained in:
7 files changed
+16
-11
No files matched your search
@@ -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
@@ -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"
|
||||||
'');
|
'');
|
||||||
|
|||||||
+5
-4
@@ -6,10 +6,11 @@ let
|
|||||||
else if config.passwordFile != null
|
else if config.passwordFile != null
|
||||||
then ''<(echo -n "$(cat ${config.passwordFile})")''
|
then ''<(echo -n "$(cat ${config.passwordFile})")''
|
||||||
else if config.keyFile != null
|
else if config.keyFile != null
|
||||||
then lib.warn
|
then
|
||||||
("The option `keyFile` is deprecated."
|
lib.warn
|
||||||
+ "Use passwordFile instead if you want to use interactive login or settings.keyFile if you want to use key file login")
|
("The option `keyFile` is deprecated."
|
||||||
config.keyFile
|
+ "Use passwordFile instead if you want to use interactive login or settings.keyFile if you want to use key file login")
|
||||||
|
config.keyFile
|
||||||
else null;
|
else null;
|
||||||
keyFileArgs = ''\
|
keyFileArgs = ''\
|
||||||
${lib.optionalString (keyFile != null) "--key-file ${keyFile}"} \
|
${lib.optionalString (keyFile != null) "--key-file ${keyFile}"} \
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@
|
|||||||
readOnly = true;
|
readOnly = true;
|
||||||
default =
|
default =
|
||||||
[
|
[
|
||||||
(if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then {
|
(if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then {
|
||||||
boot.swraid.enable = true;
|
boot.swraid.enable = true;
|
||||||
} else {
|
} else {
|
||||||
boot.initrd.services.swraid.enable = true;
|
boot.initrd.services.swraid.enable = true;
|
||||||
|
|||||||
+1
-1
@@ -7,13 +7,13 @@ diskoLib.testLib.makeDiskoTest {
|
|||||||
disko-config = ../example/complex.nix;
|
disko-config = ../example/complex.nix;
|
||||||
extraSystemConfig = {
|
extraSystemConfig = {
|
||||||
fileSystems."/zfs_legacy_fs".options = [ "nofail" ]; # TODO find out why we need this!
|
fileSystems."/zfs_legacy_fs".options = [ "nofail" ]; # TODO find out why we need this!
|
||||||
|
fileSystems."/zfs_fs".options = [ "nofail" ]; # TODO find out why we need this!
|
||||||
};
|
};
|
||||||
testMode = "direct";
|
testMode = "direct";
|
||||||
extraTestScript = ''
|
extraTestScript = ''
|
||||||
machine.succeed("test -b /dev/zroot/zfs_testvolume");
|
machine.succeed("test -b /dev/zroot/zfs_testvolume");
|
||||||
machine.succeed("test -b /dev/md/raid1p1");
|
machine.succeed("test -b /dev/md/raid1p1");
|
||||||
|
|
||||||
|
|
||||||
machine.succeed("mountpoint /zfs_fs");
|
machine.succeed("mountpoint /zfs_fs");
|
||||||
machine.succeed("mountpoint /zfs_legacy_fs");
|
machine.succeed("mountpoint /zfs_legacy_fs");
|
||||||
machine.succeed("mountpoint /ext4onzfs");
|
machine.succeed("mountpoint /ext4onzfs");
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ diskoLib.testLib.makeDiskoTest {
|
|||||||
disko-config = ../example/complex.nix;
|
disko-config = ../example/complex.nix;
|
||||||
extraSystemConfig = {
|
extraSystemConfig = {
|
||||||
fileSystems."/zfs_legacy_fs".options = [ "nofail" ]; # TODO find out why we need this!
|
fileSystems."/zfs_legacy_fs".options = [ "nofail" ]; # TODO find out why we need this!
|
||||||
|
fileSystems."/zfs_fs".options = [ "nofail" ]; # TODO find out why we need this!
|
||||||
};
|
};
|
||||||
extraTestScript = ''
|
extraTestScript = ''
|
||||||
machine.succeed("test -b /dev/zroot/zfs_testvolume");
|
machine.succeed("test -b /dev/zroot/zfs_testvolume");
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ diskoLib.makeDiskImageScript {
|
|||||||
system.stateVersion = config.system.nixos.version;
|
system.stateVersion = config.system.nixos.version;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
checked = !pkgs.hostPlatform.isRiscV64;
|
checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user