Fediversity/deployment/check/data-model-tf-proxmox/setups/template.nix
Kiara Grouwstra 080950ad0b
comment on test template equal to final config
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
2025-10-25 21:07:59 +02:00

70 lines
1.7 KiB
Nix

{
config,
system,
modulesPath,
sources ? import ../../../../npins,
...
}:
let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (pkgs.callPackage ../../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
targetSystem
httpBackend
node-name
imageDatastoreId
;
in
(pkgs.callPackage ../../../utils.nix { }).evalModel (
{ config, ... }:
{
imports = [ ../../common/model.nix ];
config = {
environments.default = environment: {
resources."operator-environment".login-shell = {
wheel = true;
username = "operator";
};
implementation =
{
required-resources,
...
}:
{
tf-proxmox-template = {
nixos-configuration = {
imports = [
(mkNixosConfiguration environment required-resources)
./shared.nix
];
};
system = targetSystem;
ssh = {
host = nodeName;
};
inherit
node-name
httpBackend
imageDatastoreId
;
};
};
};
};
options.default =
let
env = config.environments.default;
in
lib.mkOption {
type = env.resource-mapping.output-type;
default = env.deployment {
deployment-name = "default";
# normally our template is distinct, but our test cannot download build deps due to sandboxing
configuration = config."example-configuration";
};
};
}
)