forked from Fediversity/Fediversity
data model: add TF test #4
2 changed files with 28 additions and 16 deletions
|
@ -1,11 +1,13 @@
|
||||||
{
|
{
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
config,
|
config,
|
||||||
|
inputs ? (import ../../../default.nix { }).inputs,
|
||||||
|
sources ? import ../../../npins,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (sources) nixpkgs;
|
||||||
|
lib = import "${nixpkgs}/lib";
|
||||||
eval =
|
eval =
|
||||||
module:
|
module:
|
||||||
(lib.evalModules {
|
(lib.evalModules {
|
||||||
|
@ -33,8 +35,21 @@ let
|
||||||
authentication.password = "password";
|
authentication.password = "password";
|
||||||
};
|
};
|
||||||
nixos-configuration =
|
nixos-configuration =
|
||||||
{ ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../common/sharedOptions.nix
|
||||||
|
../common/targetNode.nix
|
||||||
|
"${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
|
||||||
|
];
|
||||||
|
|
||||||
|
inherit (config) enableAcme;
|
||||||
|
acmeNodeIP = if config.enableAcme then config.nodes.acme.networking.primaryIPAddress else null;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
hello
|
||||||
|
];
|
||||||
|
|
||||||
users.users = config.resources.shell.login-shell.apply (
|
users.users = config.resources.shell.login-shell.apply (
|
||||||
lib.filterAttrs (_name: value: value ? login-shell) requests
|
lib.filterAttrs (_name: value: value ? login-shell) requests
|
||||||
);
|
);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ./constants.nix) targetMachines pathToRoot;
|
inherit (import ./constants.nix) targetMachines pathToRoot;
|
||||||
|
escapedJson = v: lib.replaceStrings [ "\"" ] [ "\\\\\"" ] (lib.strings.toJSON v);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
_class = "nixosTest";
|
_class = "nixosTest";
|
||||||
|
@ -43,20 +44,16 @@ in
|
||||||
|
|
||||||
# INSTANTIATE
|
# INSTANTIATE
|
||||||
command=(nix-instantiate --expr '
|
command=(nix-instantiate --expr '
|
||||||
let
|
import ${pathToRoot}/deployment/nixos.nix {
|
||||||
configuration = { pkgs, config, ... }: {
|
configuration = import ${pathToRoot}/deployment/check/data-model/deployment.nix {
|
||||||
imports = [
|
config = builtins.fromJSON "${
|
||||||
${pathToRoot}/deployment/check/common/sharedOptions.nix
|
escapedJson {
|
||||||
${pathToRoot}/deployment/check/common/targetNode.nix
|
inherit (config) enableAcme;
|
||||||
];
|
acmeNodeIP = if config.enableAcme then config.nodes.acme.networking.primaryIPAddress else null;
|
||||||
enableAcme = ${lib.strings.toJSON config.enableAcme};
|
}
|
||||||
acmeNodeIP = if config.enableAcme then config.nodes.acme.networking.primaryIPAddress else null;
|
}";
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
hello
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
in
|
}
|
||||||
import ${pathToRoot}/deployment/nixos.nix { inherit configuration; }
|
|
||||||
')
|
')
|
||||||
# DEPLOY
|
# DEPLOY
|
||||||
host="root@${nodeName}"
|
host="root@${nodeName}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue