nixos-shell
nixos-shell copied to clipboard
Can't access custom nixos configuration attr
Most nix
commands and tools seem to have a default search path that they look at, including nixos-shell
. For example
nixos-shell --flake .#foo
searches at .#nixosConfigurations.foo
first.
However, most nix
commands and tools will fall back to searching at the top level if that fails. So if I do
nix build .#my.custom.path.foo
it will first try to find packages.<system>.my.custom.path.foo
, but if that fails it will look for plain my.custom.path.foo
before giving up.
nixos-shell
does not do this, it requires the configurations to be at specific paths.
I'm thinking this might be because nixos-shell
takes two kinds of inputs: configurations and modules, and it can only tell the difference by the path. One option is to have a default (I would guess configuration). But also this could be specified at the command line with a --module
or --configuration
flag.