diff --git a/flake.nix b/flake.nix index 1eb56b9..169495e 100644 --- a/flake.nix +++ b/flake.nix @@ -4,8 +4,10 @@ inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; inputs.disko.url = "github:nix-community/disko/master"; inputs.disko.inputs.nixpkgs.follows = "nixpkgs"; + # used for testing + inputs.nixos-images.url = "github:nix-community/nixos-images"; - outputs = { self, disko, nixpkgs, ... }: + outputs = { self, disko, nixpkgs, nixos-images, ... }: let supportedSystems = [ "x86_64-linux" @@ -32,6 +34,7 @@ from-nixos = import ./tests/from-nixos.nix { inherit pkgs; disko = disko.nixosModules.disko; + kexec-installer = nixos-images.packages.${pkgs.system}.kexec-installer-nixos-unstable; makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix"); eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix"); }; diff --git a/tests/from-nixos.nix b/tests/from-nixos.nix index 6032572..974753e 100644 --- a/tests/from-nixos.nix +++ b/tests/from-nixos.nix @@ -2,12 +2,9 @@ , makeTest ? import , eval-config ? import , disko ? "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix" +, kexec-installer , ... }: let - kexec_tarball = builtins.fetchurl { - url = "https://github.com/nix-community/nixos-images/releases/download/nixos-22.05/nixos-kexec-installer-x86_64-linux.tar.gz"; - sha256 = "sha256:1ff7rc0n8w1vab7k9sir3029sizfaq8yx7y8r1id94gcqrr2n1sd"; - }; systemToInstall = { modulesPath, ... }: { imports = [ disko @@ -114,7 +111,7 @@ makeTest { ssh-add /etc/sshKey ${../nixos-remote} \ --no-ssh-copy-id \ - --kexec ${kexec_tarball} \ + --kexec ${kexec-installer}/nixos-kexec-installer-${pkgs.stdenv.hostPlatform.system}.tar.gz \ --store-paths ${toString evaledSystem.config.system.build.disko} ${toString evaledSystem.config.system.build.toplevel} \ root@installed >&2 """)