2024-12-12 14:41:43 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Ryan Lahfa <ryan.lahfa@dgnum.eu>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
2025-02-04 22:07:47 +01:00
|
|
|
{ pkgs, lib, ... }:
|
2024-12-07 16:20:53 +01:00
|
|
|
let
|
|
|
|
inherit (pkgs.pseudofile) dir symlink;
|
2025-02-04 22:07:47 +01:00
|
|
|
# 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
|
|
|
|
);
|
2024-12-07 16:20:53 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
# TODO: support dynamic reconfiguration once we are in the target VLAN?
|
|
|
|
filesystem = dir {
|
|
|
|
etc = dir {
|
2025-02-04 22:07:47 +01:00
|
|
|
"resolv.conf" = symlink "${resolvconf}";
|
2024-12-07 16:20:53 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|