Commit d6ea7646 authored by Robert Hensing's avatar Robert Hensing
Browse files

nixosTests.nixos-rebuild-specialisations: Use modular entrypoint

Modernize it. This allows the test to be extended, and pkgs to be
reused (later) to speed up evaluations a bit.
I believe this also makes it run on darwin hosts, but my linux-builder's
disk is too small to fit the massive closure of this test.

(cherry picked from commit 1396a03bee18a0993a4f3e97fda8938ff61c2918)
parent 3362ec86
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -699,7 +699,7 @@ in {
  nixops = handleTest ./nixops/default.nix {};
  nixos-generate-config = handleTest ./nixos-generate-config.nix {};
  nixos-rebuild-install-bootloader = handleTestOn ["x86_64-linux"] ./nixos-rebuild-install-bootloader.nix {};
  nixos-rebuild-specialisations = handleTestOn ["x86_64-linux"] ./nixos-rebuild-specialisations.nix {};
  nixos-rebuild-specialisations = runTestOn ["x86_64-linux"] ./nixos-rebuild-specialisations.nix;
  nixos-rebuild-target-host = runTest ./nixos-rebuild-target-host.nix;
  nixpkgs = pkgs.callPackage ../modules/misc/nixpkgs/test.nix { inherit evalMinimalConfig; };
  nixseparatedebuginfod = handleTest ./nixseparatedebuginfod.nix {};
+7 −3
Original line number Diff line number Diff line
import ./make-test-python.nix ({ pkgs, ... }: {
{ hostPkgs, ... }: {
  name = "nixos-rebuild-specialisations";

  # TODO: remove overlay from  nixos/modules/profiles/installation-device.nix
  #        make it a _small package instead, then remove pkgsReadOnly = false;.
  node.pkgsReadOnly = false;

  nodes = {
    machine = { lib, pkgs, ... }: {
      imports = [
@@ -32,7 +36,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {

  testScript =
    let
      configFile = pkgs.writeText "configuration.nix" ''
      configFile = hostPkgs.writeText "configuration.nix" ''
        { lib, pkgs, ... }: {
          imports = [
            ./hardware-configuration.nix
@@ -119,4 +123,4 @@ import ./make-test-python.nix ({ pkgs, ... }: {
          machine.fail("nixos-rebuild boot --specialisation foo")
          machine.fail("nixos-rebuild boot -c foo")
    '';
})
}