forked from fediversity/fediversity
96 lines
2.3 KiB
Nix
96 lines
2.3 KiB
Nix
{
|
|
config,
|
|
system,
|
|
modulesPath,
|
|
sources ? import ../../../../npins,
|
|
...
|
|
}@args:
|
|
let
|
|
inherit (sources) nixpkgs;
|
|
pkgs = import nixpkgs { inherit system; };
|
|
inherit (pkgs) lib;
|
|
inherit (pkgs.callPackage ../../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
|
|
inherit (config)
|
|
nodeName
|
|
pathToRoot
|
|
targetSystem
|
|
sshOpts
|
|
httpBackend
|
|
key-file
|
|
node-name
|
|
bridge
|
|
vlanId
|
|
templateId
|
|
imageDatastoreId
|
|
vmDatastoreId
|
|
cdDatastoreId
|
|
ipv4Gateway
|
|
ipv4Address
|
|
ipv6Gateway
|
|
ipv6Address
|
|
;
|
|
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,
|
|
deployment-name,
|
|
}:
|
|
{
|
|
tf-proxmox-vm = {
|
|
nixos-configuration = {
|
|
imports = [
|
|
(mkNixosConfiguration environment required-resources)
|
|
./shared.nix
|
|
];
|
|
};
|
|
system = targetSystem;
|
|
ssh = {
|
|
username = "root";
|
|
host = nodeName;
|
|
inherit key-file sshOpts;
|
|
};
|
|
caller = "deployment/check/data-model-tf-proxmox/setups/vm.nix";
|
|
inherit
|
|
args
|
|
deployment-name
|
|
httpBackend
|
|
node-name
|
|
bridge
|
|
vlanId
|
|
templateId
|
|
imageDatastoreId
|
|
vmDatastoreId
|
|
cdDatastoreId
|
|
ipv4Gateway
|
|
ipv4Address
|
|
ipv6Gateway
|
|
ipv6Address
|
|
;
|
|
root-path = pathToRoot;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
options.default =
|
|
let
|
|
env = config.environments.default;
|
|
in
|
|
lib.mkOption {
|
|
type = env.resource-mapping.output-type;
|
|
default = env.deployment {
|
|
deployment-name = "default";
|
|
configuration = config."example-configuration";
|
|
};
|
|
};
|
|
}
|
|
)
|