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;