nixos-servers/nixos/modules/default.nix

34 lines
770 B
Nix
Raw Normal View History

{ lib, config, ... }:
2024-01-14 16:59:32 +00:00
let cfg = config.lab;
in
2023-11-24 12:52:51 +00:00
{
imports = [
2024-01-06 23:22:44 +00:00
./storage.nix
./terraform-database
./ssh-certificates.nix
./k3s
./backups.nix
2024-01-07 22:06:27 +00:00
./networking
./data-sharing.nix
2024-01-31 20:58:23 +00:00
./globals.nix
];
2024-01-31 20:58:23 +00:00
# TODO: remove this option; make this explicit on the host.
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 {
backups.enable = true;
data-sharing.enable = true;
2024-01-31 20:58:23 +00:00
networking.dmz.allowConnectivity = true;
};
2023-11-24 12:52:51 +00:00
}