nixos-config/lib/fudo/sites.nix

73 lines
1.8 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
siteOpts = { site, ... }: {
options = {
site = mkOption {
type = types.str;
description = "Site name.";
default = site;
};
gateway-v4 = mkOption {
type = with types; nullOr str;
description = "Gateway to use for public ipv4 internet access.";
default = null;
};
gateway-v6 = mkOption {
type = with types; nullOr str;
description = "Gateway to use for public ipv6 internet access.";
default = null;
};
gateway-host = mkOption {
type = with types; nullOr str;
description = "Identity of the host to act as a gateway.";
default = null;
};
local-groups = mkOption {
type = with types; listOf str;
description = "List of groups which should exist at this site.";
default = [ ];
};
local-users = mkOption {
type = with types; listOf str;
description = "List of users which should exist on all hosts at this site.";
default = [ ];
};
local-admins = mkOption {
type = with types; listOf str;
description = "List of admin users which should exist on all hosts at this site.";
default = [ ];
};
enable-monitoring =
mkEnableOption "Enable site-wide monitoring with prometheus.";
nameservers = mkOption {
type = with types; listOf str;
description = "List of nameservers to be used by hosts at this site.";
default = [ ];
};
timezone = mkOption {
type = types.str;
description = "Timezone of the site.";
example = "America/Winnipeg";
};
};
};
in {
options.fudo.sites = mkOption {
type = with types; attrsOf (submodule siteOpts);
description = "Site configurations for all sites known to the system.";
default = { };
};
}