infrastructure/machines/liminix/ap-dev/dns.nix
sinavir 3b7662e45a
All checks were successful
Run pre-commit on all files / pre-commit (push) Successful in 22s
feat(ap): init ap-dev
2025-02-20 01:06:56 +01:00

25 lines
606 B
Nix

# SPDX-FileCopyrightText: 2024 Ryan Lahfa <ryan.lahfa@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
{ pkgs, lib, ... }:
let
inherit (pkgs.pseudofile) dir symlink;
# TODO: imho, DNS should be static and provided by the router?
dns = [
"8.8.8.8"
"8.8.4.4"
"1.0.0.1"
];
resolvconf = pkgs.writeText "resolv.conf" (
lib.concatMapStringsSep "\n" (dns: ''echo "nameserver ${dns}" >> resolv.conf'') dns
);
in
{
# TODO: support dynamic reconfiguration once we are in the target VLAN?
filesystem = dir {
etc = dir {
"resolv.conf" = symlink "${resolvconf}";
};
};
}