From 116d9990019df687d73061552c8629732d00a868 Mon Sep 17 00:00:00 2001 From: niten Date: Mon, 8 Nov 2021 15:59:39 -0800 Subject: [PATCH] nsd: add stateDir option to nsd config. Previously, it was hardcoded to /var/lib/nsd, which remains the default value. --- nixos/modules/services/networking/nsd.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/nsd.nix b/nixos/modules/services/networking/nsd.nix index 2ac0a8c7922..4c6f54bd0fa 100644 --- a/nixos/modules/services/networking/nsd.nix +++ b/nixos/modules/services/networking/nsd.nix @@ -6,7 +6,7 @@ let cfg = config.services.nsd; username = "nsd"; - stateDir = "/var/lib/nsd"; + stateDir = cfg.stateDir; pidFile = stateDir + "/var/nsd.pid"; # build nsd with the options needed for the given config @@ -411,6 +411,14 @@ let ''; }; + stateDir = mkOption { + type = types.str; + default = "/var/lib/nsd"; + description = '' + Directory at which to store NSD state. + ''; + }; + zoneStats = mkOption { type = types.nullOr types.str; default = null;