fix: keep systemd-resolved enabled on both hosts

This commit is contained in:
OpenAI Coding Assistant
2026-09-06 16:31:09 -05:00
parent 40d7de6b7f
commit 8b6f90dad9
3 changed files with 49 additions and 8 deletions
+13 -5
View File
@@ -1,5 +1,4 @@
{
config,
inputs,
lib,
pkgs,
@@ -8,14 +7,14 @@
let
latest = import inputs.nixpkgs-latest {
inherit (pkgs.stdenv.hostPlatform) system;
config = pkgs.config;
inherit (pkgs) config;
};
in
{
# NetworkManager owns local DNS on workstations. With dhcpcd (EC2),
# NixOS wires resolvconf to resolved. Preserve both hosts' existing behavior.
# Keep resolvectl available on both hosts. NixOS wires NetworkManager and
# /etc/resolv.conf to resolved; DHCP/VPNs still supply the upstream DNS.
services.resolved = {
enable = lib.mkDefault (!config.networking.networkmanager.enable);
enable = true;
settings.Resolve = {
LLMNR = false;
MulticastDNS = false;
@@ -23,6 +22,15 @@ in
};
};
# The NixOS module enables resolved at boot. Retry exits without a start limit.
systemd.services.systemd-resolved = {
unitConfig.StartLimitIntervalSec = 0;
serviceConfig = {
Restart = "always";
RestartSec = "5s";
};
};
# Local, opt-in SOCKS client only. Keep the daemon on the system package pin.
# No relay/exit, control listener, transparent proxy or host DNS changes.
services.tor = {