2024-10-25 14:45:07 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
2023-11-28 00:40:46 +01:00
|
|
|
{
|
2023-05-18 06:57:58 +02:00
|
|
|
networking = {
|
|
|
|
useNetworkd = true;
|
|
|
|
dhcpcd.enable = false;
|
2023-12-17 16:34:05 +01:00
|
|
|
useDHCP = false;
|
2023-12-16 22:41:06 +01:00
|
|
|
renameInterfacesByMac = lib.mkIf (!config.boot.isContainer) (
|
2024-07-26 22:12:48 +02:00
|
|
|
lib.mapAttrs (_: v: v.mac) (config.secrets.secrets.local.networking.interfaces or { })
|
2023-12-16 22:41:06 +01:00
|
|
|
);
|
2023-05-18 06:57:58 +02:00
|
|
|
};
|
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
2024-12-04 22:47:40 +01:00
|
|
|
wait-online.enable = false;
|
2023-05-18 06:57:58 +02:00
|
|
|
};
|
2024-12-04 22:47:40 +01:00
|
|
|
systemd.services.NetworkManager-wait-online.enable = false;
|
2025-01-05 17:52:03 +01:00
|
|
|
# systemd resolved does not fully support dnssd
|
|
|
|
# Also it isn't yet supported by cups so for printer finding we need avahi
|
|
|
|
services.avahi = {
|
|
|
|
enable = true;
|
|
|
|
ipv4 = true;
|
|
|
|
ipv6 = true;
|
|
|
|
nssmdns4 = true;
|
|
|
|
nssmdns6 = true;
|
2025-01-06 00:19:17 +01:00
|
|
|
publish = {
|
|
|
|
enable = true;
|
|
|
|
addresses = true;
|
|
|
|
};
|
2025-01-05 17:52:03 +01:00
|
|
|
};
|
2024-12-04 22:47:40 +01:00
|
|
|
|
|
|
|
# Do not take down the network for too long when upgrading,
|
|
|
|
# This also prevents failures of services that are restarted instead of stopped.
|
|
|
|
# It will use `systemctl restart` rather than stopping it with `systemctl stop`
|
|
|
|
# followed by a delayed `systemctl start`.
|
|
|
|
systemd.services.systemd-networkd.stopIfChanged = false;
|
|
|
|
# Services that are only restarted might be not able to resolve when resolved is stopped before
|
|
|
|
systemd.services.systemd-resolved.stopIfChanged = false;
|
2023-05-18 06:57:58 +02:00
|
|
|
services.resolved = {
|
|
|
|
enable = true;
|
2023-09-02 20:11:06 +02:00
|
|
|
# man I whish dnssec would be viable to use
|
2024-05-13 22:54:21 +02:00
|
|
|
dnssec = "false";
|
2023-09-02 20:11:06 +02:00
|
|
|
llmnr = "false";
|
|
|
|
extraConfig = ''
|
|
|
|
Domains=~.
|
2025-01-05 22:27:49 +01:00
|
|
|
MulticastDNS=false
|
2023-09-02 20:11:06 +02:00
|
|
|
'';
|
2023-05-18 06:57:58 +02:00
|
|
|
};
|
|
|
|
}
|