Open
Description
Describe the bug
It seems that -c
is accepted, but effectively ignored, if the user passes a flakeref at the same time.
Let me show via 3 cases:
Case: -c
works with my devShells.x86_64-linux.default
(git
is coming from the shell):
╭ slynux ~/code/nixcfg cole-nixcfg-devenv-env 240ms
╰🡒 nix develop --ignore-env -c git --version
warning: Git tree '/home/cole/code/nixcfg' is dirty
git version 2.49.0
Case: it works as expected when I manually enter the devShell, the run a command:
╭ slynux ~/code/nixcfg shell-ci-env
╰🡒 nix develop .#devenv
╭ slynux ~/code/nixcfg cole-nixcfg-devenv-env
╰🡒 cargo
Rust's package manager
Case: -c
does not work when I use a flakeref to a different devShell:
╭ slynux ~/code/nixcfg shell-ci-env 2min 37sec 383ms
╰🡒 nix develop .#devenv -c cargo
╭ slynux ~/code/nixcfg cole-nixcfg-devenv-env 823ms
╰🡒
As you can see, it:
- does not run my command
- drops me into the develop environment
Expected behavior
That nix develop -c
works similarly with and without a flakeref specified
Metadata
I repro'd this with: 2.29, 2.20.9, 2.24, I'm not sure it has ever worked.
Additional context
Checklist
- checked latest Nix manual (source)
- checked open bug issues and pull requests for possible duplicates
Add 👍 to issues you find important.