nixos-config/config/fudo.nix
2019-12-25 17:20:36 -06:00

96 lines
2.0 KiB
Nix

{ lib, config, pkgs, ... }:
with lib;
let
hostOpts = { config, ... }: {
options = {
ipv6Address = mkOption {
type = types.str;
description = ''
The V6 IP of a given host, if any.
'';
};
ipv4Address = mkOption {
type = types.str;
description = ''
The V4 IP of a given host, if any.
'';
};
macAddress = mkOption {
type = types.str;
description = ''
The MAC address of a given host, if desired for IP reservation.
'';
};
};
};
localNameServerOpts = { config, ... }: {
options = {
ipv6Address = mkOption {
type = types.str;
description = ''
The V6 IP of a given host, if any.
'';
};
ipv4Address = mkOption {
type = types.str;
description = ''
The V4 IP of a given host, if any.
'';
};
ipv4ReverseDomain = mkOption {
type = types.str;
description = ''
The domain of the IPv4 address range for which this nameserver is responsible.
Eg: 0.10.in-addr.arpa
'';
};
};
};
in {
imports = [
./fudo/ldap.nix
];
options = {
fudo.localNetwork.hosts = mkOption {
type = types.listOf (submodule hostOpts);
default = {};
description = ''
A map of hostname => { host_attributes }.
'';
};
fudo.localNetwork.domain = mkOption {
type = types.str;
description = ''
The domain to use for the local network.
'';
};
fudo.localNetwork.hostAliases = mkOption {
type = types.attrsOf types.str;
default = {};
description = ''
A mapping of hostAlias => hostName to use on the local network.
'';
};
fudo.localNetwork.localNameServer = mkOption {
type = (submodule localNameServerOpts);
description = ''
The master nameserver of the local network.
'';
};
};
}