chore(dnsmasq): filter dynamic systems better

This commit is contained in:
arcnmx 2024-04-16 09:23:50 -07:00
parent 60e27b1b59
commit 66d60c7977
4 changed files with 8 additions and 3 deletions

View file

@ -140,6 +140,9 @@ in {
default = domain;
};
global.enable = mkEnableOption "globally routeable";
online.enable = mkEnableOption "a deployed machine" // {
default = true;
};
hostnameForNetwork = mkOption {
type = attrsOf str;
default = {};

View file

@ -12,8 +12,8 @@
inherit (lib.trivial) mapNullable;
cfg = config.services.dnsmasq;
inherit (inputs.self.lib) systems;
reisenSystems = filterAttrs (_: system:
system.config.proxmox.enabled && system.config.proxmox.node.name == "reisen"
localSystems = filterAttrs (_: system:
system.config.access.online.enable && system.config.network.local.enable or false
) systems;
mkHostRecordPairs = _: system: [
(mkHostRecordPair "int" system)
@ -70,7 +70,7 @@ in {
resolveLocalQueries = mkForce false;
settings = {
host-record = mapAttrsToList mkHostRecord systemHosts;
dynamic-host = mapAttrsToList mkDynamicHostRecord reisenSystems;
dynamic-host = mapAttrsToList mkDynamicHostRecord localSystems;
server =
if config.networking.nameservers' != [ ] then map (ns: ns.address) (filter filterns' config.networking.nameservers')
else filter filterns config.networking.nameservers

View file

@ -4,6 +4,7 @@ _: {
modules = [
./nixos.nix
];
access.online.enable = false;
network.networks = {
local = {
fqdn = null;

View file

@ -5,6 +5,7 @@ _: {
modules = [
./nixos.nix
];
access.online.enable = false;
network.networks = {
local = {
address4 = null;