mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
chore(dnsmasq): filter dynamic systems better
This commit is contained in:
parent
60e27b1b59
commit
66d60c7977
4 changed files with 8 additions and 3 deletions
|
|
@ -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 = {};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ _: {
|
|||
modules = [
|
||||
./nixos.nix
|
||||
];
|
||||
access.online.enable = false;
|
||||
network.networks = {
|
||||
local = {
|
||||
fqdn = null;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ _: {
|
|||
modules = [
|
||||
./nixos.nix
|
||||
];
|
||||
access.online.enable = false;
|
||||
network.networks = {
|
||||
local = {
|
||||
address4 = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue