Config working despite options "used but not defined"

I’ve configured a working service, but when evaluating it on the REPL it says two options are “used but not defined”:

nix-repl> config.systemd.services.external-webcam
{ after = [ ... ]; aliases = [ ... ]; before = [ ... ]; bindsTo = [ ... ]; confinement = { ... }; conflicts = [ ... ]; description = ""; documentation = [ ... ]; enable = true; environment = { ... }; jobScripts = [ ... ]; onFailure = [ ... ]; onSuccess = [ ... ]; overrideStrategy = "asDropinIfExists"; partOf = [ ... ]; path = [ ... ]; postStart = ""; postStop = ""; preStart = ""; preStop = ""; reload = ""; reloadIfChanged = false; reloadTriggers = [ ... ]; requiredBy = [ ... ]; requires = [ ... ]; requisite = [ ... ]; restartIfChanged = true; restartTriggers = [ ... ]; runner = «derivation /nix/store/hv40pfj6n9hlj90g3bacskvxp87b0mgh-external-webcam-runner.drv»; script = "/nix/store/zzi6s8lg4ji46a95r5iprdag85rgbjgv-gphoto2-2.5.28/bin/gphoto2 --stdout --capture-movie |\n  /nix/store/f7k39fqz199vv16n6c682ckmwplxa3k9-ffmpeg-full-6.1-bin/bin/ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video0\n"; scriptArgs = ""; serviceConfig = { ... }; startAt = [ ... ]; startLimitBurst = «error: error:
       … while evaluating the attribute 'value'

         at /nix/store/cg5bfa4lfwxwvx3bxwsxv02km06ax2rp-nixos/nixos/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       … while calling the 'addErrorContext' builtin

         at /nix/store/cg5bfa4lfwxwvx3bxwsxv02km06ax2rp-nixos/nixos/lib/modules.nix:809:17:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |                 ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `systemd.services.external-webcam.startLimitBurst' is used but not defined.»; startLimitIntervalSec = «error: error:
       … while evaluating the attribute 'value'

         at /nix/store/cg5bfa4lfwxwvx3bxwsxv02km06ax2rp-nixos/nixos/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       … while calling the 'addErrorContext' builtin

         at /nix/store/cg5bfa4lfwxwvx3bxwsxv02km06ax2rp-nixos/nixos/lib/modules.nix:809:17:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |                 ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `systemd.services.external-webcam.startLimitIntervalSec' is used but not defined.»; stopIfChanged = true; unitConfig = { ... }; upheldBy = [ ... ]; upholds = [ ... ]; wantedBy = [ ... ]; wants = [ ... ]; }

Shouldn’t such options have a default (even if it’s just null), to make the code handling unspecified values easier and the REPL output more readable?

Did you mean StartLimitBurst?

In that case, you wanted systemd.services.external-webcam.serviceConfig.startLimitBurst (note the serviceConfig)

No, I mean the Nix REPL produces spurious errors about properties I haven’t specified (and don’t want to specify).

Very strange. Only other thing I can think of is that you’re not using a flake. Is NIXOS_CONFIG set or something else which may be influencing the eval?

From here, your config looks fine.

I’ve not set NIXOS_CONFIG.