2024-01-06 20:45:18 +00:00
|
|
|
{ lib, config, ... }:
|
|
|
|
|
2024-01-14 16:59:32 +00:00
|
|
|
let cfg = config.lab;
|
2024-01-06 20:45:18 +00:00
|
|
|
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
|
2024-01-07 22:06:27 +00:00
|
|
|
./networking
|
2024-01-01 12:16:11 +00:00
|
|
|
./data-sharing.nix
|
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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-01-14 16:59:32 +00:00
|
|
|
config.lab = lib.mkIf cfg.dataHost.enable {
|
2024-01-06 20:45:18 +00:00
|
|
|
backups.enable = true;
|
|
|
|
data-sharing.enable = true;
|
|
|
|
networking.allowDMZConnectivity = true;
|
|
|
|
};
|
2023-11-24 12:52:51 +00:00
|
|
|
}
|