diff --git a/nixos/modules/services/networking/nsd.nix b/nixos/modules/services/networking/nsd.nix
index 4c6f54bd0fa..c432c37d564 100644
--- a/nixos/modules/services/networking/nsd.nix
+++ b/nixos/modules/services/networking/nsd.nix
@@ -411,14 +411,6 @@ 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;
@@ -640,6 +632,14 @@ in
       '';
     };
 
+    stateDir = mkOption {
+      type = types.str;
+      default = "/var/lib/nsd";
+      description = ''
+          Directory at which to store NSD state.
+        '';
+    };
+
     statistics = mkOption {
       type = types.nullOr types.int;
       default = null;