From ec776ce5b9a2fa9b3cbe17c7796f9c27fb765c27 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 5 Oct 2025 15:56:34 +0900 Subject: [PATCH] nixos/dnscache: replace systemd `script` with `ExecStart` --- nixos/modules/services/networking/dnscache.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/networking/dnscache.nix b/nixos/modules/services/networking/dnscache.nix index f360aa86c7b8..938033a8583f 100644 --- a/nixos/modules/services/networking/dnscache.nix +++ b/nixos/modules/services/networking/dnscache.nix @@ -108,17 +108,16 @@ in daemontools djbdns ]; + environment.FORWARDONLY = lib.mkIf cfg.forwardOnly "1"; preStart = '' rm -rf /var/lib/dnscache dnscache-conf dnscache dnscache /var/lib/dnscache ${config.services.dnscache.ip} rm -rf /var/lib/dnscache/root ln -sf ${dnscache-root} /var/lib/dnscache/root ''; - script = '' - cd /var/lib/dnscache/ - ${lib.optionalString cfg.forwardOnly "export FORWARDONLY=1"} - exec ./run - ''; + serviceConfig.StateDirectory = "dnscache"; + serviceConfig.WorkingDirectory = "/var/lib/dnscache"; + serviceConfig.ExecStart = "/var/lib/dnscache/run"; }; }; }