forked from fediversity/fediversity
62 lines
1.5 KiB
Nix
62 lines
1.5 KiB
Nix
{
|
|
config,
|
|
system,
|
|
sources ? import ../../../npins,
|
|
...
|
|
}@args:
|
|
let
|
|
self = "deployment/check/data-model-ssh/data-model.nix";
|
|
inherit (sources) nixpkgs;
|
|
pkgs = import nixpkgs { inherit system; };
|
|
inherit (pkgs) lib;
|
|
inherit (pkgs.callPackage ../common/utils.nix { }) mkNixosConfiguration;
|
|
inherit (config)
|
|
nodeName
|
|
pathToRoot
|
|
targetSystem
|
|
sshOpts
|
|
;
|
|
in
|
|
(pkgs.callPackage ../../utils.nix { }).evalModel (
|
|
{ config, ... }:
|
|
{
|
|
imports = [ ../common/model.nix ];
|
|
config = {
|
|
environments.default = environment: {
|
|
resources."operator-environment".login-shell.username = "operator";
|
|
implementation =
|
|
{
|
|
required-resources,
|
|
deployment-name,
|
|
...
|
|
}:
|
|
{
|
|
ssh-host = {
|
|
nixos-configuration = mkNixosConfiguration environment required-resources;
|
|
system = targetSystem;
|
|
ssh = {
|
|
username = "root";
|
|
host = nodeName;
|
|
key-file = null;
|
|
inherit sshOpts;
|
|
};
|
|
module = self;
|
|
inherit args deployment-name;
|
|
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";
|
|
};
|
|
};
|
|
}
|
|
)
|