diff --git a/checks/flash/flake-module.nix b/checks/flash/flake-module.nix index 4a57fec36..0acbc64d2 100644 --- a/checks/flash/flake-module.nix +++ b/checks/flash/flake-module.nix @@ -67,9 +67,11 @@ self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.toplevel self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript.drvPath - (import ../installation/facter-report.nix pkgs.hostPlatform.system) ] - ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs); + ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs) + ++ builtins.map (import ../installation/facter-report.nix) ( + lib.filter (lib.hasSuffix "linux") config.systems + ); closureInfo = pkgs.closureInfo { rootPaths = dependencies; }; in { diff --git a/checks/installation/flake-module.nix b/checks/installation/flake-module.nix index 90fa4f528..5cef1e428 100644 --- a/checks/installation/flake-module.nix +++ b/checks/installation/flake-module.nix @@ -1,8 +1,8 @@ { + config, self, lib, privateInputs, - ... }: { @@ -14,26 +14,29 @@ # you can get a new one by adding # client.fail("cat test-flake/machines/test-install-machine/facter.json >&2") # to the installation test. - clan.machines.test-install-machine-without-system = { - fileSystems."/".device = lib.mkDefault "/dev/vda"; - boot.loader.grub.device = lib.mkDefault "/dev/vda"; - - imports = [ - self.nixosModules.test-install-machine-without-system - ]; - }; - - clan.machines.test-install-machine-with-system = - { pkgs, ... }: - { - # https://git.clan.lol/clan/test-fixtures - facter.reportPath = import ./facter-report.nix pkgs.hostPlatform.system; - + clan.machines = { + test-install-machine-without-system = { fileSystems."/".device = lib.mkDefault "/dev/vda"; boot.loader.grub.device = lib.mkDefault "/dev/vda"; - imports = [ self.nixosModules.test-install-machine-without-system ]; + imports = [ + self.nixosModules.test-install-machine-without-system + ]; }; + } + // (lib.listToAttrs ( + lib.map ( + system: + lib.nameValuePair "test-install-machine-${system}" { + facter.reportPath = import ./facter-report.nix system; + + fileSystems."/".device = lib.mkDefault "/dev/vda"; + boot.loader.grub.device = lib.mkDefault "/dev/vda"; + + imports = [ self.nixosModules.test-install-machine-without-system ]; + } + ) (lib.filter (lib.hasSuffix "linux") config.systems) + )); flake.nixosModules = { test-install-machine-without-system = @@ -149,15 +152,15 @@ closureInfo = pkgs.closureInfo { rootPaths = [ privateInputs.clan-core-for-checks - self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.toplevel - self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.initialRamdisk - self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.diskoScript + self.nixosConfigurations."test-install-machine-${pkgs.hostPlatform.system}".config.system.build.toplevel + self.nixosConfigurations."test-install-machine-${pkgs.hostPlatform.system}".config.system.build.initialRamdisk + self.nixosConfigurations."test-install-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript pkgs.stdenv.drvPath pkgs.bash.drvPath pkgs.buildPackages.xorg.lndir - (import ./facter-report.nix pkgs.hostPlatform.system) ] - ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs); + ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs) + ++ builtins.map (import ./facter-report.nix) (lib.filter (lib.hasSuffix "linux") config.systems); }; in pkgs.lib.mkIf (pkgs.stdenv.isLinux && !pkgs.stdenv.isAarch64) { @@ -205,7 +208,7 @@ # Prepare test flake and Nix store flake_dir = prepare_test_flake( temp_dir, - "${self.checks.x86_64-linux.clan-core-for-checks}", + "${self.checks.${pkgs.hostPlatform.system}.clan-core-for-checks}", "${closureInfo}" ) @@ -286,7 +289,7 @@ # Prepare test flake and Nix store flake_dir = prepare_test_flake( temp_dir, - "${self.checks.x86_64-linux.clan-core-for-checks}", + "${self.checks.${pkgs.hostPlatform.system}.clan-core-for-checks}", "${closureInfo}" ) diff --git a/checks/morph/flake-module.nix b/checks/morph/flake-module.nix index 49e68ea29..92a262867 100644 --- a/checks/morph/flake-module.nix +++ b/checks/morph/flake-module.nix @@ -1,5 +1,6 @@ { self, + config, ... }: { @@ -29,15 +30,17 @@ nodes = { actual = - { pkgs, ... }: + { pkgs, lib, ... }: let dependencies = [ pkgs.stdenv.drvPath pkgs.stdenvNoCC self.nixosConfigurations.test-morph-machine.config.system.build.toplevel - (import ../installation/facter-report.nix pkgs.hostPlatform.system) ] - ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs); + ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs) + ++ builtins.map (import ../installation/facter-report.nix) ( + lib.filter (lib.hasSuffix "linux") config.systems + ); closureInfo = pkgs.closureInfo { rootPaths = dependencies; }; in diff --git a/checks/update/flake-module.nix b/checks/update/flake-module.nix index c157c112e..6ff1ad2ef 100644 --- a/checks/update/flake-module.nix +++ b/checks/update/flake-module.nix @@ -1,4 +1,4 @@ -{ self, ... }: +{ self, config, ... }: { # Machine for update test clan.machines.test-update-machine = { @@ -105,6 +105,7 @@ perSystem = { pkgs, + lib, ... }: { @@ -122,9 +123,11 @@ pkgs.bash.drvPath pkgs.buildPackages.xorg.lndir pkgs.bubblewrap - (import ../installation/facter-report.nix pkgs.hostPlatform.system) ] - ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs); + ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs) + ++ builtins.map (import ../installation/facter-report.nix) ( + lib.filter (lib.hasSuffix "linux") config.systems + ); }; in self.clanLib.test.containerTest {