2024-01-06 20:45:18 +00:00
|
|
|
{ lib, config, ... }:
|
|
|
|
|
|
|
|
let cfg = config.lab.dataHost;
|
|
|
|
in
|
2023-11-24 12:52:51 +00:00
|
|
|
{
|
2023-12-30 13:34:21 +00:00
|
|
|
imports = [
|
2024-01-06 23:22:44 +00:00
|
|
|
./storage.nix
|
2023-12-30 13:34:21 +00:00
|
|
|
./terraform-database
|
|
|
|
./ssh-certificates.nix
|
|
|
|
./k3s
|
|
|
|
./backups.nix
|
2023-12-30 15:11:28 +00:00
|
|
|
./networking.nix
|
2024-01-01 12:16:11 +00:00
|
|
|
./data-sharing.nix
|
2024-01-07 19:24:12 +00:00
|
|
|
./dns
|
2023-12-30 13:34:21 +00:00
|
|
|
];
|
2024-01-06 20:45:18 +00:00
|
|
|
|
|
|
|
options.lab.dataHost.enable = lib.mkOption {
|
|
|
|
default = false;
|
|
|
|
type = lib.types.bool;
|
|
|
|
description = ''
|
|
|
|
Whether this machine holds application data.
|
|
|
|
This enables NFS and PostgreSQL to serve this data, and sets up backups.
|
|
|
|
Also enables networking on the DMZ to enable serving data.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
config.lab = lib.mkIf cfg.enable {
|
|
|
|
backups.enable = true;
|
|
|
|
data-sharing.enable = true;
|
|
|
|
networking.allowDMZConnectivity = true;
|
|
|
|
};
|
2023-11-24 12:52:51 +00:00
|
|
|
}
|