infrastructure/machines/liminix/ap-test/dns.nix
Elias Coppens c4782f15c5
All checks were successful
Run pre-commit on all files / pre-commit (push) Successful in 22s
Run pre-commit on all files / pre-commit (pull_request) Successful in 23s
feat: add test AP
Signed-off-by: Elias Coppens <elias@dgnum.eu>
2025-03-01 16:00:40 +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}";
};
};
}