diff --git a/flake.nix b/flake.nix index 2909642..81e1ce2 100644 --- a/flake.nix +++ b/flake.nix @@ -51,24 +51,30 @@ # TODO: also add a test here once we have https://github.com/NixOS/nixpkgs/pull/228346 merged netboot-installer = ./nix/netboot-installer/module.nix; }; - checks.x86_64-linux = + checks = let - pkgs = nixos-unstable.legacyPackages.x86_64-linux; - in - { - kexec-installer-unstable = pkgs.callPackage ./nix/kexec-installer/test.nix { - kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-unstable-noninteractive; - }; - shellcheck = pkgs.runCommand "shellcheck" + # re-export the packages as checks + packages = forAllSystems (system: nixos-unstable.lib.mapAttrs' (n: nixos-unstable.lib.nameValuePair "package-${n}") self.packages.${system}); + checks = + let + pkgs = nixos-unstable.legacyPackages.x86_64-linux; + in { - nativeBuildInputs = [ pkgs.shellcheck ]; - } '' - shellcheck ${(pkgs.nixos [self.nixosModules.kexec-installer]).config.system.build.kexecRun} - touch $out - ''; - kexec-installer-2311 = nixos-2311.legacyPackages.x86_64-linux.callPackage ./nix/kexec-installer/test.nix { - kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-2311-noninteractive; - }; - }; + kexec-installer-unstable = pkgs.callPackage ./nix/kexec-installer/test.nix { + kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-unstable-noninteractive; + }; + shellcheck = pkgs.runCommand "shellcheck" + { + nativeBuildInputs = [ pkgs.shellcheck ]; + } '' + shellcheck ${(pkgs.nixos [self.nixosModules.kexec-installer]).config.system.build.kexecRun} + touch $out + ''; + kexec-installer-2311 = nixos-2311.legacyPackages.x86_64-linux.callPackage ./nix/kexec-installer/test.nix { + kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-2311-noninteractive; + }; + }; + in + nixos-unstable.lib.recursiveUpdate packages { x86_64-linux = checks; }; }; }