25 lines
606 B
Nix
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}";
|
|
};
|
|
};
|
|
}
|