forked from Fediversity/Fediversity
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com> Reviewed-on: Fediversity/Fediversity#421 Reviewed-by: Nicolas Jeannerod <nicolas.jeannerod@moduscreate.com> Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Kiara Grouwstra <kiara@procolix.eu> Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
51 lines
1,004 B
Nix
51 lines
1,004 B
Nix
{
|
|
inputs,
|
|
lib,
|
|
config,
|
|
sources,
|
|
...
|
|
}:
|
|
|
|
let
|
|
inherit (builtins) readFile;
|
|
inherit (lib) trim mkOption types;
|
|
|
|
in
|
|
|
|
{
|
|
_class = "nixops4Resource";
|
|
|
|
imports = [ ./sharedOptions.nix ];
|
|
|
|
options = {
|
|
nodeName = mkOption {
|
|
type = types.str;
|
|
description = ''
|
|
The name of the node in the NixOS test;
|
|
needed for recovering the node configuration to prepare its deployment.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = {
|
|
ssh = {
|
|
host = config.nodeName;
|
|
hostPublicKey = readFile (config.pathToCwd + "/${config.nodeName}_host_key.pub");
|
|
};
|
|
|
|
nixpkgs = inputs.nixpkgs;
|
|
|
|
nixos.module = {
|
|
imports = [
|
|
./targetNode.nix
|
|
(lib.modules.importJSON (config.pathToCwd + "/${config.nodeName}-network.json"))
|
|
];
|
|
|
|
_module.args = { inherit inputs sources; };
|
|
enableAcme = config.enableAcme;
|
|
acmeNodeIP = trim (readFile (config.pathToCwd + "/acme_server_ip"));
|
|
|
|
nixpkgs.hostPlatform = "x86_64-linux";
|
|
};
|
|
};
|
|
}
|