Adding `trusted-substituters` on the fly when running nixos-rebuild?

Accessing is extremely from my side for the moment.

I tried to use the --option binary-cache option when I run nixos-rebuild boot, but it complained that

warning: ignoring untrusted substituter ''

and ignored the binary cache that I supply.

Is there a way to force nixos-rebuild to trust my cache on-the-fly?

Though I can add it into configuration.nix, but it can only be applied after I succeed to run nixos-rebuild !

Try adding the query param ?trusted=1 at the end of your substituter URL.

Seems not working:

$> nix-shell -p blender --option binary-caches ''
warning: ignoring untrusted substituter ''

Running nix commands with sudo seems resolves this problem.

To add a substitute, you need to be a trusted user. By default only root is a trusted user.