aboutsummaryrefslogtreecommitdiff
path: root/tests/nixos/default.nix
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-07 02:58:26 +0100
committereldritch horrors <pennae@lix.systems>2024-03-06 21:32:47 -0700
commit097acae35bd99cebd6cdb22cd6e498f3a50951f1 (patch)
tree502d6e2794d064f116d4c05e3a4828732fd73fd0 /tests/nixos/default.nix
parent65f1b15c953805816133db3d3f92ff4c35c57741 (diff)
tests/nixos: Test remote build against older versions
(cherry picked from commit e502d1cf945fb3cdd0ca1e1c16ec330ccab51c7b) Change-Id: If6a1758b6457c5dae9305829c4d71d1905cfca22
Diffstat (limited to 'tests/nixos/default.nix')
-rw-r--r--tests/nixos/default.nix100
1 files changed, 100 insertions, 0 deletions
diff --git a/tests/nixos/default.nix b/tests/nixos/default.nix
index 4c1cf785c..f2873f80e 100644
--- a/tests/nixos/default.nix
+++ b/tests/nixos/default.nix
@@ -14,6 +14,13 @@ let
_module.args.nixpkgs = nixpkgs;
};
+ # Checks that a NixOS configuration does not contain any references to our
+ # locally defined Nix version.
+ checkOverrideNixVersion = { pkgs, lib, ... }: {
+ # pkgs.nix: The new Nix in this repo
+ # We disallow it, to make sure we don't accidentally use it.
+ system.forbiddenDependenciesRegex = lib.strings.escapeRegex "nix-${pkgs.nix.version}";
+ };
in
{
@@ -21,8 +28,101 @@ in
remoteBuilds = runNixOSTestFor "x86_64-linux" ./remote-builds.nix;
+ # Test our Nix as a client against remotes that are older
+
+ remoteBuilds_remote_2_3 = runNixOSTestFor "x86_64-linux" {
+ name = "remoteBuilds_remote_2_3";
+ imports = [ ./remote-builds.nix ];
+ builders.config = { lib, pkgs, ... }: {
+ imports = [ checkOverrideNixVersion ];
+ nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
+ };
+ };
+
+ remoteBuilds_remote_2_13 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
+ name = "remoteBuilds_remote_2_13";
+ imports = [ ./remote-builds.nix ];
+ builders.config = { lib, pkgs, ... }: {
+ imports = [ checkOverrideNixVersion ];
+ nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
+ };
+ });
+
+ # TODO: (nixpkgs update) remoteBuilds_remote_2_18 = ...
+
+ # Test our Nix as a builder for clients that are older
+
+ remoteBuilds_local_2_3 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
+ name = "remoteBuilds_local_2_3";
+ imports = [ ./remote-builds.nix ];
+ nodes.client = { lib, pkgs, ... }: {
+ imports = [ checkOverrideNixVersion ];
+ nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
+ };
+ });
+
+ remoteBuilds_local_2_13 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
+ name = "remoteBuilds_local_2_13";
+ imports = [ ./remote-builds.nix ];
+ nodes.client = { lib, pkgs, ... }: {
+ imports = [ checkOverrideNixVersion ];
+ nix.package = lib.mkForce pkgs.nixVersions.nix_2_13;
+ };
+ });
+
+ # TODO: (nixpkgs update) remoteBuilds_local_2_18 = ...
+
+ # End remoteBuilds tests
+
remoteBuildsSshNg = runNixOSTestFor "x86_64-linux" ./remote-builds-ssh-ng.nix;
+ # Test our Nix as a client against remotes that are older
+
+ remoteBuildsSshNg_remote_2_3 = runNixOSTestFor "x86_64-linux" {
+ name = "remoteBuildsSshNg_remote_2_3";
+ imports = [ ./remote-builds-ssh-ng.nix ];
+ builders.config = { lib, pkgs, ... }: {
+ imports = [ checkOverrideNixVersion ];
+ nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
+ };
+ };
+
+ remoteBuildsSshNg_remote_2_13 = runNixOSTestFor "x86_64-linux" {
+ name = "remoteBuildsSshNg_remote_2_13";
+ imports = [ ./remote-builds-ssh-ng.nix ];
+ builders.config = { lib, pkgs, ... }: {
+ imports = [ checkOverrideNixVersion ];
+ nix.package = lib.mkForce pkgs.nixVersions.nix_2_13;
+ };
+ };
+
+ # TODO: (nixpkgs update) remoteBuildsSshNg_remote_2_18 = ...
+
+ # Test our Nix as a builder for clients that are older
+
+ # FIXME: these tests don't work yet
+ /*
+ remoteBuildsSshNg_local_2_3 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
+ name = "remoteBuildsSshNg_local_2_3";
+ imports = [ ./remote-builds-ssh-ng.nix ];
+ nodes.client = { lib, pkgs, ... }: {
+ imports = [ checkOverrideNixVersion ];
+ nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
+ };
+ });
+
+ remoteBuildsSshNg_local_2_13 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
+ name = "remoteBuildsSshNg_local_2_13";
+ imports = [ ./remote-builds-ssh-ng.nix ];
+ nodes.client = { lib, pkgs, ... }: {
+ imports = [ checkOverrideNixVersion ];
+ nix.package = lib.mkForce pkgs.nixVersions.nix_2_13;
+ };
+ });
+
+ # TODO: (nixpkgs update) remoteBuildsSshNg_local_2_18 = ...
+ */
+
nix-copy-closure = runNixOSTestFor "x86_64-linux" ./nix-copy-closure.nix;
nix-copy = runNixOSTestFor "x86_64-linux" ./nix-copy.nix;