70 lines
1.6 KiB
Nix
70 lines
1.6 KiB
Nix
|
# This module defines options for use by all C3D2 machines.
|
||
|
|
||
|
{ config, lib, ... }:
|
||
|
|
||
|
let cfg = config.c3d2;
|
||
|
in {
|
||
|
options.c3d2 = with lib;
|
||
|
with lib.types; {
|
||
|
|
||
|
isInHq = mkEnableOption "HQ presence (TODO: what is this? association to VLAN 5?)";
|
||
|
|
||
|
enableMotd = mkOption {
|
||
|
type = bool;
|
||
|
default = cfg.isInHq;
|
||
|
defaultText = literalExample "config.c3d2.isInHq";
|
||
|
};
|
||
|
|
||
|
mapPublicHosts = mkOption {
|
||
|
type = bool;
|
||
|
default = false;
|
||
|
description = ''
|
||
|
Whether to add all external HQ host mappings to /etc/hosts.
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
mapHqHosts = mkOption {
|
||
|
type = bool;
|
||
|
default = cfg.isInHq;
|
||
|
description = ''
|
||
|
Whether to add all internal HQ host mappings to /etc/hosts.
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
acmeEmail = mkOption {
|
||
|
type = str;
|
||
|
default = "mail@c3d2.de";
|
||
|
description = ''
|
||
|
Admin email address to use for Letsencrypt
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
hq = {
|
||
|
|
||
|
interface = mkOption {
|
||
|
type = nullOr str;
|
||
|
default = null;
|
||
|
example = "eth0";
|
||
|
description = ''
|
||
|
Configure the given interface name with an internal IP address.
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
enableBinaryCache = mkOption {
|
||
|
type = bool;
|
||
|
default = cfg.isInHq;
|
||
|
defaultText = literalExample "config.c3d2.isInHq";
|
||
|
description = "Whether to enable the local Nix binary cache";
|
||
|
};
|
||
|
|
||
|
enableMpdProxy = mkOption {
|
||
|
type = bool;
|
||
|
default = false;
|
||
|
description = "Whether to proxy the local MPD database";
|
||
|
};
|
||
|
|
||
|
};
|
||
|
|
||
|
};
|
||
|
}
|