mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
chore: nf-fmt-nix
This commit is contained in:
parent
c2089adbc7
commit
5cbde2e43f
4 changed files with 33 additions and 24 deletions
|
|
@ -26,23 +26,25 @@
|
|||
];
|
||||
mapDynamic4 = replaceStrings ["10.1.1."] ["0.0.0."];
|
||||
mapDynamic6 = replaceStrings ["fd0a::"] ["2001::"];
|
||||
mkDynamicHostRecords = system: map (mkDynamicHostRecord system) (
|
||||
singleton system.access.fqdn
|
||||
++ system.access.fqdnAliases
|
||||
);
|
||||
mkDynamicHostRecords = system:
|
||||
map (mkDynamicHostRecord system) (
|
||||
singleton system.access.fqdn
|
||||
++ system.access.fqdnAliases
|
||||
);
|
||||
mkDynamicHostRecord = system: let
|
||||
address4 = system.network.networks.local.address4 or null;
|
||||
address6 = system.network.networks.local.address6 or null;
|
||||
in fqdn:
|
||||
concatStringsSep "," (
|
||||
singleton fqdn
|
||||
++ optional (address4 != null)
|
||||
(toString (mapNullable mapDynamic4 address4))
|
||||
++ optional (address6 != null)
|
||||
(toString (mapNullable mapDynamic6 address6))
|
||||
++ singleton
|
||||
cfg.dynamic.interface
|
||||
);
|
||||
in
|
||||
fqdn:
|
||||
concatStringsSep "," (
|
||||
singleton fqdn
|
||||
++ optional (address4 != null)
|
||||
(toString (mapNullable mapDynamic4 address4))
|
||||
++ optional (address6 != null)
|
||||
(toString (mapNullable mapDynamic6 address6))
|
||||
++ singleton
|
||||
cfg.dynamic.interface
|
||||
);
|
||||
mkHostRecordPair = network: system: let
|
||||
address4 = system.network.networks.${network}.address4 or null;
|
||||
address6 = system.network.networks.${network}.address6 or null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue