forked from fediversity/fediversity
properly propagate modulesPath
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
parent
ccc7d24bf0
commit
f5b8304475
30 changed files with 104 additions and 43 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
sources,
|
||||
lib,
|
||||
providers,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
|
|
@ -23,7 +24,7 @@ in
|
|||
../common/targetResource.nix
|
||||
];
|
||||
|
||||
_module.args = { inherit inputs sources; };
|
||||
_module.args = { inherit inputs sources modulesPath; };
|
||||
|
||||
inherit nodeName pathToRoot pathFromRoot;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,12 @@
|
|||
outputs =
|
||||
inputs:
|
||||
import ./mkFlake.nix inputs (
|
||||
{ inputs, sources, ... }:
|
||||
{
|
||||
inputs,
|
||||
sources,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
inputs.nixops4.modules.flake.default
|
||||
|
|
@ -15,7 +20,7 @@
|
|||
|
||||
nixops4Deployments.check-deployment-basic = {
|
||||
imports = [ ./deployment/check/basic/deployment.nix ];
|
||||
_module.args = { inherit inputs sources; };
|
||||
_module.args = { inherit inputs sources modulesPath; };
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
inputs,
|
||||
sources,
|
||||
lib,
|
||||
modulesPath,
|
||||
}:
|
||||
|
||||
let
|
||||
|
|
@ -15,7 +16,7 @@ let
|
|||
|
||||
makeTargetResource = nodeName: {
|
||||
imports = [ ../common/targetResource.nix ];
|
||||
_module.args = { inherit inputs sources; };
|
||||
_module.args = { inherit inputs sources modulesPath; };
|
||||
inherit
|
||||
nodeName
|
||||
pathToRoot
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
inputs,
|
||||
sources,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
|
@ -19,7 +20,12 @@
|
|||
];
|
||||
|
||||
nixops4Deployments = import ./deployment/check/cli/deployments.nix {
|
||||
inherit inputs sources lib;
|
||||
inherit
|
||||
inputs
|
||||
sources
|
||||
lib
|
||||
modulesPath
|
||||
;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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; };
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,10 +45,10 @@ 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; };
|
||||
_module.args = { inherit inputs sources modulesPath; };
|
||||
inherit nodeName pathToRoot pathFromRoot;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
inputs,
|
||||
sources,
|
||||
lib,
|
||||
modulesPath,
|
||||
}:
|
||||
|
||||
let
|
||||
|
|
@ -15,7 +16,7 @@ let
|
|||
|
||||
makeTargetResource = nodeName: {
|
||||
imports = [ ../common/targetResource.nix ];
|
||||
_module.args = { inherit inputs sources; };
|
||||
_module.args = { inherit inputs sources modulesPath; };
|
||||
inherit
|
||||
nodeName
|
||||
pathToRoot
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
inputs,
|
||||
sources,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
|
@ -19,7 +20,12 @@
|
|||
];
|
||||
|
||||
nixops4Deployments.check-deployment-panel = import ./deployment/check/panel/deployment.nix {
|
||||
inherit inputs sources lib;
|
||||
inherit
|
||||
inputs
|
||||
sources
|
||||
lib
|
||||
modulesPath
|
||||
;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ runNixOSTest {
|
|||
sources
|
||||
pkgs
|
||||
;
|
||||
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||
};
|
||||
imports = [
|
||||
./proxmoxTest.nix
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
(lib.evalModules {
|
||||
specialArgs = {
|
||||
inherit pkgs inputs;
|
||||
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
|
||||
};
|
||||
modules = [
|
||||
./data-model.nix
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@ let
|
|||
inputs = inputs';
|
||||
};
|
||||
|
||||
flake-parts-lib = import "${sources.flake-parts}/lib.nix" { inherit (nixpkgs) lib; };
|
||||
inherit (nixpkgs) lib outPath;
|
||||
flake-parts-lib = import "${sources.flake-parts}/lib.nix" { inherit lib; };
|
||||
in
|
||||
|
||||
flakeModule:
|
||||
|
|
@ -41,6 +42,7 @@ flake-parts-lib.mkFlake
|
|||
self = self';
|
||||
specialArgs = {
|
||||
inherit sources;
|
||||
modulesPath = "${builtins.toString outPath}/nixos/modules";
|
||||
};
|
||||
}
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue