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;
|
default = domain;
|
||||||
};
|
};
|
||||||
global.enable = mkEnableOption "globally routeable";
|
global.enable = mkEnableOption "globally routeable";
|
||||||
|
online.enable = mkEnableOption "a deployed machine" // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
hostnameForNetwork = mkOption {
|
hostnameForNetwork = mkOption {
|
||||||
type = attrsOf str;
|
type = attrsOf str;
|
||||||
default = {};
|
default = {};
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
inherit (lib.trivial) mapNullable;
|
inherit (lib.trivial) mapNullable;
|
||||||
cfg = config.services.dnsmasq;
|
cfg = config.services.dnsmasq;
|
||||||
inherit (inputs.self.lib) systems;
|
inherit (inputs.self.lib) systems;
|
||||||
reisenSystems = filterAttrs (_: system:
|
localSystems = filterAttrs (_: system:
|
||||||
system.config.proxmox.enabled && system.config.proxmox.node.name == "reisen"
|
system.config.access.online.enable && system.config.network.local.enable or false
|
||||||
) systems;
|
) systems;
|
||||||
mkHostRecordPairs = _: system: [
|
mkHostRecordPairs = _: system: [
|
||||||
(mkHostRecordPair "int" system)
|
(mkHostRecordPair "int" system)
|
||||||
|
|
@ -70,7 +70,7 @@ in {
|
||||||
resolveLocalQueries = mkForce false;
|
resolveLocalQueries = mkForce false;
|
||||||
settings = {
|
settings = {
|
||||||
host-record = mapAttrsToList mkHostRecord systemHosts;
|
host-record = mapAttrsToList mkHostRecord systemHosts;
|
||||||
dynamic-host = mapAttrsToList mkDynamicHostRecord reisenSystems;
|
dynamic-host = mapAttrsToList mkDynamicHostRecord localSystems;
|
||||||
server =
|
server =
|
||||||
if config.networking.nameservers' != [ ] then map (ns: ns.address) (filter filterns' config.networking.nameservers')
|
if config.networking.nameservers' != [ ] then map (ns: ns.address) (filter filterns' config.networking.nameservers')
|
||||||
else filter filterns config.networking.nameservers
|
else filter filterns config.networking.nameservers
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ _: {
|
||||||
modules = [
|
modules = [
|
||||||
./nixos.nix
|
./nixos.nix
|
||||||
];
|
];
|
||||||
|
access.online.enable = false;
|
||||||
network.networks = {
|
network.networks = {
|
||||||
local = {
|
local = {
|
||||||
fqdn = null;
|
fqdn = null;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ _: {
|
||||||
modules = [
|
modules = [
|
||||||
./nixos.nix
|
./nixos.nix
|
||||||
];
|
];
|
||||||
|
access.online.enable = false;
|
||||||
network.networks = {
|
network.networks = {
|
||||||
local = {
|
local = {
|
||||||
address4 = null;
|
address4 = null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue