numtide/system-manager

nix flags are unusable with system-manager cli

eclairevoyant opened this issue · 1 comments

Describe the bug

--show-trace or other nix flags don't get passed to nix and error instead

To Reproduce

Steps to reproduce the behavior:

  1. Run sudo system-manager --nix-option --show-trace build --flake .
  2. Error below
error: unexpected argument '--show-trace' found

Usage: system-manager [OPTIONS] <COMMAND>

For more information, try '--help'.

Expected behavior

Pass the flag to nix, as it claims to do.

System information

system-manager 0.1.0

Additional context

Tried both with and without --nix-option.
Additionally, the documentation isn't consistent about where flags go (i.e. before vs after the subcommand), so I assume its position doesn't matter.

Wasn't able to identify the nix build command that's being run based on the source code, if you can provide that, I'll just use that instead.

r-vdp commented

Yeah --nix-option does what --option does for nix. But not everything can be expressed with that, --show-trace being one example of that.

I'd need to check how to pass any extra options to nix directly.

I just pushed a commit so you can set RUST_LOG=debug and see the nix commands being run.