How to use impureEnvVars

I have a script that is called in my derivation. It requires an env variable from the host, but I’m unable to pass in the env variable via impureEnvVars, even after setting my derivation as a fixed output derivation. Am I misunderstanding the usage of impureEnvVars?

impureEnvVars are inherited from the nix-daemon. You can set them via

Not sure if I see that systemd variable (is the right term variable?). I only see nix-daemon.service and nix-daemon.socket in systemctl

you want to add a new entry to the nix-daemon.service file via NixOS Search