properly propagate modulesPath

Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
Kiara Grouwstra 2025-10-23 23:04:32 +02:00
parent 43e4d3a497
commit 098298a31c
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
23 changed files with 73 additions and 34 deletions

View file

@ -1,4 +1,5 @@
{
pkgs,
runNixOSTest,
inputs,
sources,
@ -9,7 +10,10 @@ runNixOSTest {
../common/nixosTest.nix
./nixosTest.nix
];
_module.args = { inherit inputs sources; };
_module.args = {
inherit inputs sources;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
inherit (import ./constants.nix)
targetMachines
pathToRoot

View file

@ -1,4 +1,5 @@
{
pkgs,
runNixOSTest,
inputs,
sources,
@ -9,7 +10,10 @@ runNixOSTest {
../common/nixosTest.nix
./nixosTest.nix
];
_module.args = { inherit inputs sources; };
_module.args = {
inherit inputs sources;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
inherit (import ./constants.nix)
targetMachines
pathToRoot

View file

@ -3,6 +3,7 @@
lib,
pkgs,
config,
modulesPath,
sources,
...
}:
@ -75,7 +76,7 @@ in
machine =
(pkgs.nixos [
./targetNode.nix
"${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix"
"${modulesPath}/../lib/testing/nixos-test-base.nix"
config.system.extraDependenciesFromModule
{
nixpkgs.hostPlatform = "x86_64-linux";

View file

@ -4,6 +4,7 @@
config,
hostPkgs,
sources,
modulesPath,
...
}:
@ -114,7 +115,7 @@ in
(genAttrs config.targetMachines (_: {
imports = [
./targetNode.nix
] ++ (lib.optional config.useFlake "${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.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;

View file

@ -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"))
"${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix"
"${modulesPath}/../lib/testing/nixos-test-base.nix"
];
_module.args = { inherit inputs sources; };

View file

@ -1,6 +1,6 @@
{
lib,
sources ? import ../../../npins,
modulesPath,
...
}:
{
@ -11,7 +11,7 @@
imports = [
../common/sharedOptions.nix
../common/targetNode.nix
"${sources.nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
"${modulesPath}/profiles/qemu-guest.nix"
];
users.users = environment.config.resources."operator-environment".login-shell.apply {

View file

@ -1,6 +1,7 @@
{
config,
system,
modulesPath,
inputs,
sources ? import ../../../npins,
...
@ -9,7 +10,7 @@ let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (pkgs.callPackage ../common/utils.nix { }) mkNixosConfiguration;
inherit (pkgs.callPackage ../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
pathFromRoot
@ -17,7 +18,7 @@ let
;
in
(pkgs.callPackage ../../utils.nix { inherit inputs; }).evalModel (
{ config, ... }:
{ config, modulesPath, ... }:
{
imports = [ ../common/model.nix ];
config = {
@ -44,7 +45,7 @@ in
nixos.module = {
imports = [
(mkNixosConfiguration environment required-resources)
"${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix"
"${modulesPath}/../lib/testing/nixos-test-base.nix"
];
};
_module.args = { inherit inputs sources; };

View file

@ -1,4 +1,5 @@
{
pkgs,
runNixOSTest,
inputs,
sources,
@ -11,7 +12,10 @@ runNixOSTest {
../common/nixosTest.nix
./nixosTest.nix
];
_module.args = { inherit inputs sources; };
_module.args = {
inherit inputs sources;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
inherit (import ./constants.nix)
targetMachines
pathToRoot

View file

@ -7,7 +7,7 @@
outputs =
inputs:
import ./mkFlake.nix inputs (
{ inputs, ... }:
{ inputs, modulesPath, ... }:
let
system = "x86_64-linux";
in
@ -18,7 +18,7 @@
nixops4Deployments.check-deployment-model =
(import ./deployment/check/data-model-nixops4/data-model.nix {
inherit system inputs;
inherit system inputs modulesPath;
config = {
inherit (import ./deployment/check/data-model-nixops4/constants.nix) pathToRoot pathFromRoot;
nodeName = "nixops4";

View file

@ -1,6 +1,7 @@
{
config,
system,
modulesPath,
sources ? import ../../../npins,
...
}@args:
@ -8,7 +9,7 @@ let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (pkgs.callPackage ../common/utils.nix { }) mkNixosConfiguration;
inherit (pkgs.callPackage ../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
pathToRoot
@ -17,7 +18,7 @@ let
;
in
(pkgs.callPackage ../../utils.nix { }).evalModel (
{ config, ... }:
{ config, modulesPath, ... }:
{
imports = [ ../common/model.nix ];
config = {
@ -34,7 +35,7 @@ in
nixos-configuration = {
imports = [
(mkNixosConfiguration environment required-resources)
"${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix"
"${modulesPath}/../lib/testing/nixos-test-base.nix"
];
};
system = targetSystem;

View file

@ -1,4 +1,5 @@
{
pkgs,
runNixOSTest,
inputs,
sources,
@ -11,7 +12,10 @@ runNixOSTest {
../common/nixosTest.nix
./nixosTest.nix
];
_module.args = { inherit inputs sources; };
_module.args = {
inherit inputs sources;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
inherit (import ./constants.nix)
targetMachines
pathToRoot

View file

@ -1,6 +1,7 @@
{
lib,
pkgs,
modulesPath,
...
}:
let
@ -8,7 +9,7 @@ let
nodeName = "ssh";
deploy =
(import ./data-model.nix {
inherit system;
inherit system modulesPath;
config = {
inherit nodeName;
inherit (import ./constants.nix) pathToRoot;

View file

@ -42,7 +42,10 @@ pkgs.testers.runNixOSTest {
../common/nixosTest.nix
./nixosTest.nix
];
_module.args = { inherit inputs sources; };
_module.args = {
inherit inputs sources;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
inherit (import ./constants.nix)
targetMachines
pathToRoot

View file

@ -1,6 +1,7 @@
{
lib,
pkgs,
modulesPath,
sources,
...
}:
@ -17,7 +18,7 @@ let
# FIXME generate the image `nixos-generate` was to make, but now do it for a desired `-c configuration.nix` rather than whatever generic thing now
template-deployment =
(import ./setups/template.nix {
inherit sources system;
inherit sources system modulesPath;
config = {
httpBackend = tfBackend "proxmox-test/upload";
nodeName = "pve";
@ -28,7 +29,7 @@ let
}).default.tf-proxmox-template;
vm-deployment =
(import ./setups/vm.nix {
inherit sources system;
inherit sources system modulesPath;
config = {
httpBackend = tfBackend "proxmox-test/nixos";
inherit (import ./constants.nix) pathToRoot;

View file

@ -1,6 +1,7 @@
{
config,
system,
modulesPath,
sources ? import ../../../../npins,
...
}:
@ -8,7 +9,7 @@ let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (pkgs.callPackage ../../common/utils.nix { inherit sources; }) mkNixosConfiguration;
inherit (pkgs.callPackage ../../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
targetSystem

View file

@ -1,6 +1,7 @@
{
config,
system,
modulesPath,
sources ? import ../../../../npins,
...
}@args:
@ -8,7 +9,7 @@ let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (pkgs.callPackage ../../common/utils.nix { inherit sources; }) mkNixosConfiguration;
inherit (pkgs.callPackage ../../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
pathToRoot

View file

@ -2,13 +2,14 @@
config,
system,
sources ? import ../../../npins,
modulesPath,
...
}@args:
let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (pkgs.callPackage ../common/utils.nix { }) mkNixosConfiguration;
inherit (pkgs.callPackage ../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
pathToRoot
@ -18,7 +19,7 @@ let
;
in
(pkgs.callPackage ../../utils.nix { }).evalModel (
{ config, ... }:
{ config, modulesPath, ... }:
{
imports = [ ../common/model.nix ];
config = {
@ -34,7 +35,7 @@ in
nixos-configuration = {
imports = [
(mkNixosConfiguration environment required-resources)
"${sources.nixpkgs}/nixos/lib/testing/nixos-test-base.nix"
"${modulesPath}/../lib/testing/nixos-test-base.nix"
];
};
system = targetSystem;

View file

@ -43,7 +43,10 @@ pkgs.testers.runNixOSTest {
../common/nixosTest.nix
./nixosTest.nix
];
_module.args = { inherit inputs sources; };
_module.args = {
inherit inputs sources;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
inherit (import ./constants.nix)
targetMachines
pathToRoot

View file

@ -2,6 +2,7 @@
lib,
pkgs,
sources,
modulesPath,
...
}:
let
@ -11,7 +12,7 @@ let
backendPort = builtins.toString 8080;
deploy =
(import ./data-model.nix {
inherit system;
inherit system modulesPath;
config = {
inherit nodeName pathToRoot;
targetSystem = system;

View file

@ -1,4 +1,5 @@
{
pkgs,
runNixOSTest,
inputs,
sources,
@ -9,7 +10,10 @@ runNixOSTest {
../common/nixosTest.nix
./nixosTest.nix
];
_module.args = { inherit inputs sources; };
_module.args = {
inherit inputs sources;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
inherit (import ./constants.nix)
targetMachines
pathToRoot

View file

@ -30,6 +30,7 @@ runNixOSTest {
sources
pkgs
;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
imports = [
./proxmoxTest.nix

View file

@ -14,27 +14,27 @@
deployment-basic = import ./check/basic {
inherit (pkgs.testers) runNixOSTest;
inherit inputs sources;
inherit pkgs inputs sources;
};
deployment-cli = import ./check/cli {
inherit (pkgs.testers) runNixOSTest;
inherit inputs sources;
inherit pkgs inputs sources;
};
deployment-panel = import ./check/panel {
inherit (pkgs.testers) runNixOSTest;
inherit inputs sources;
inherit pkgs inputs sources;
};
deployment-model-ssh = import ./check/data-model-ssh {
inherit (pkgs.testers) runNixOSTest;
inherit inputs sources;
inherit pkgs inputs sources;
};
deployment-model-nixops4 = import ./check/data-model-nixops4 {
inherit (pkgs.testers) runNixOSTest;
inherit inputs sources;
inherit pkgs inputs sources;
};
deployment-model-tf = import ./check/data-model-tf {

View file

@ -10,6 +10,7 @@
(lib.evalModules {
specialArgs = {
inherit pkgs inputs;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
modules = [
./data-model.nix