diff --git a/deployment/check/common/deployerNode.nix b/deployment/check/common/deployerNode.nix index 3aa13ba3..dccebf92 100644 --- a/deployment/check/common/deployerNode.nix +++ b/deployment/check/common/deployerNode.nix @@ -4,6 +4,7 @@ pkgs, config, sources, + modulesPath, ... }: @@ -73,17 +74,20 @@ in ## configuration and the store paths needed to build it and ## dump them in `system.extraDependencies`. machine = - (pkgs.nixos [ - ./targetNode.nix - ../../../infra/common/nixos/repart.nix - config.system.extraDependenciesFromModule - { - nixpkgs.hostPlatform = "x86_64-linux"; - _module.args = { inherit inputs sources; }; - enableAcme = config.enableAcme; - acmeNodeIP = config.acmeNodeIP; - } - ]).config; + (pkgs.nixos ( + [ + ./targetNode.nix + ../../../infra/common/nixos/repart.nix + config.system.extraDependenciesFromModule + { + nixpkgs.hostPlatform = "x86_64-linux"; + _module.args = { inherit inputs sources; }; + enableAcme = config.enableAcme; + acmeNodeIP = config.acmeNodeIP; + } + ] + ++ (lib.optional config.useFlake "${modulesPath}/../lib/testing/nixos-test-base.nix") + )).config; in [ diff --git a/deployment/check/common/nixosTest.nix b/deployment/check/common/nixosTest.nix index 9d4e528d..3da05084 100644 --- a/deployment/check/common/nixosTest.nix +++ b/deployment/check/common/nixosTest.nix @@ -4,6 +4,7 @@ config, hostPkgs, sources, + modulesPath, ... }: @@ -67,16 +68,19 @@ in }; config = { - sourceFileset = fileset.unions [ - # NOTE: not the flake itself; it will be overridden. - ../../../mkFlake.nix - ../../../flake.lock - ../../../npins + sourceFileset = fileset.unions ( + [ + # NOTE: not the flake itself; it will be overridden. + ../../../mkFlake.nix + ../../../flake.lock + ../../../npins - ./sharedOptions.nix - ./targetNode.nix - ./targetResource.nix - ]; + ./sharedOptions.nix + ./targetNode.nix + ./targetResource.nix + ] + ++ (lib.optional config.useFlake "${modulesPath}/../lib/testing/nixos-test-base.nix") + ); acmeNodeIP = config.nodes.acme.networking.primaryIPAddress; @@ -112,7 +116,9 @@ in }; }) (genAttrs config.targetMachines (_: { - imports = [ ./targetNode.nix ]; + imports = [ + ./targetNode.nix + ] ++ (lib.optional config.useFlake (modulesPath + "/../lib/testing/nixos-test-base.nix")); _module.args = { inherit inputs sources; }; enableAcme = config.enableAcme; acmeNodeIP = if config.enableAcme then config.nodes.acme.networking.primaryIPAddress else null; diff --git a/deployment/check/common/targetNode.nix b/deployment/check/common/targetNode.nix index dbf9ca3e..6f7e593b 100644 --- a/deployment/check/common/targetNode.nix +++ b/deployment/check/common/targetNode.nix @@ -16,8 +16,6 @@ in imports = [ (modulesPath + "/profiles/qemu-guest.nix") - # FIXME needed for non-proxmox tests - # (modulesPath + "/../lib/testing/nixos-test-base.nix") ./sharedOptions.nix ]; diff --git a/deployment/check/common/targetResource.nix b/deployment/check/common/targetResource.nix index 53e07f16..8b47270d 100644 --- a/deployment/check/common/targetResource.nix +++ b/deployment/check/common/targetResource.nix @@ -3,6 +3,7 @@ lib, config, sources, + modulesPath, ... }: @@ -39,7 +40,7 @@ in imports = [ ./targetNode.nix (lib.modules.importJSON (config.pathToCwd + "/${config.nodeName}-network.json")) - ]; + ] ++ (lib.optional config.useFlake "${modulesPath}/../lib/testing/nixos-test-base.nix"); _module.args = { inherit inputs sources; }; enableAcme = config.enableAcme; diff --git a/deployment/check/data-model-nixops4/data-model.nix b/deployment/check/data-model-nixops4/data-model.nix index 7ddbe3d9..d531cae7 100644 --- a/deployment/check/data-model-nixops4/data-model.nix +++ b/deployment/check/data-model-nixops4/data-model.nix @@ -41,7 +41,12 @@ in inputs.nixops4-nixos.modules.nixops4Resource.nixos ../common/targetResource.nix ]; - nixos.module = mkNixosConfiguration environment required-resources; + nixos.module = { + imports = [ + (mkNixosConfiguration environment required-resources) + "${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix" + ]; + }; _module.args = { inherit inputs sources; }; inherit nodeName pathToRoot pathFromRoot; }; diff --git a/deployment/check/data-model-ssh/data-model.nix b/deployment/check/data-model-ssh/data-model.nix index d3df53bf..3477ac7a 100644 --- a/deployment/check/data-model-ssh/data-model.nix +++ b/deployment/check/data-model-ssh/data-model.nix @@ -31,7 +31,12 @@ in }: { ssh-host = { - nixos-configuration = mkNixosConfiguration environment required-resources; + nixos-configuration = { + imports = [ + (mkNixosConfiguration environment required-resources) + "${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix" + ]; + }; system = targetSystem; ssh = { username = "root"; diff --git a/deployment/check/data-model-tf/data-model.nix b/deployment/check/data-model-tf/data-model.nix index a765fdc1..5dab2094 100644 --- a/deployment/check/data-model-tf/data-model.nix +++ b/deployment/check/data-model-tf/data-model.nix @@ -31,7 +31,12 @@ in }: { tf-host = { - nixos-configuration = mkNixosConfiguration environment required-resources; + nixos-configuration = { + imports = [ + (mkNixosConfiguration environment required-resources) + "${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix" + ]; + }; system = targetSystem; ssh = { username = "root";