nixos-config/lib/fudo/domains.nix

95 lines
2.4 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2021-02-25 20:45:50 +00:00
with lib;
let
2021-11-13 10:30:58 -08:00
hostname = config.instance.hostname;
domain = config.instance.local-domain;
domainOpts = { name, ... }: let
domain = name;
in {
options = with types; {
domain = mkOption {
2021-11-13 10:30:58 -08:00
type = str;
description = "Domain name.";
default = domain;
};
local-networks = mkOption {
2021-11-13 10:30:58 -08:00
type = listOf str;
description =
"A list of networks to be considered trusted on this network.";
default = [ ];
};
local-users = mkOption {
2021-11-13 10:30:58 -08:00
type = listOf str;
description =
"A list of users who should have local (i.e. login) access to _all_ hosts in this domain.";
default = [ ];
};
local-admins = mkOption {
2021-11-13 10:30:58 -08:00
type = listOf str;
description =
"A list of users who should have admin access to _all_ hosts in this domain.";
default = [ ];
};
2021-02-25 20:45:50 +00:00
local-groups = mkOption {
2021-11-13 10:30:58 -08:00
type = listOf str;
2021-03-01 16:43:27 -06:00
description = "List of groups which should exist within this domain.";
default = [ ];
2021-02-25 20:45:50 +00:00
};
admin-email = mkOption {
2021-11-13 10:30:58 -08:00
type = str;
description = "Email for the administrator of this domain.";
2021-11-13 10:30:58 -08:00
default = "admin@${domain}";
};
gssapi-realm = mkOption {
2021-11-13 10:30:58 -08:00
type = str;
description = "GSSAPI (i.e. Kerberos) realm of this domain.";
2021-11-13 10:30:58 -08:00
default = toUpper domain;
};
kerberos-master = mkOption {
type = nullOr str;
description = "Hostname of the Kerberos master server for the domain, if applicable.";
default = null;
};
kerberos-slaves = mkOption {
type = listOf str;
description = "List of hosts acting as Kerberos slaves for the domain.";
default = [];
};
primary-nameserver = mkOption {
type = nullOr str;
description = "Hostname of the primary nameserver for this domain.";
default = null;
};
primary-mailserver = mkOption {
type = nullOr str;
description = "Hostname of the primary mail server for this domain.";
default = null;
};
};
};
in {
options.fudo.domains = mkOption {
type = with types; attrsOf (submodule domainOpts);
description = "Domain configurations for all domains known to the system.";
default = { };
};
2021-11-13 10:30:58 -08:00
imports = [
./domain/kerberos.nix
./domain/dns.nix
];
}