cfg/var/lan-dns.nix
2026-03-23 00:04:05 +01:00

17 lines
459 B
Nix

# Wireguard peers hardcoded in /etc/hosts until I have a nice dns solution
{ lib, var, ... }:
let
lan-hosts = lib.mapAttrs' (name: value: {
name = "${name}.lan";
inherit value;
}) var.wg.ips;
custom-hosts = with var.wg.ips; {
"git.lan" = roam;
"syncthing.roam.lan" = roam;
"qbt.lan" = roam;
};
in
rec {
hosts = lan-hosts // custom-hosts;
hostsFile = lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: "${v}\t${n}") hosts);
}