$ nix run "nixpkgs.haskellPackages.ghcWithPackages (p: [ p.lens] )" -c "ghci"
error: don't know what to do with argument 'nixpkgs.haskellPackages.ghcWithPackages (p: [ p.lens] )'
Try 'nix --help' for more information.
$ nix-shell -p "haskellPackages.ghcWithPackages (p: [ p.lens] )" --run "ghci"
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Prelude>
Is this not a use case that the new nix run
is intended to support?
The various nix subcommands generally want these things to be wrapped with paren's if they're expressions, so something like this works:
$ nix run "((import <nixpkgs> {}).haskellPackages.ghcWithPackages (p: [ p.lens] ))" -c "ghci"
Great, this also seems to work:
$ nix run "(import <nixpkgs> {}).haskellPackages.ghcWithPackages (p: [ p.lens ])"
I would like it if this change in behaviour could be documented somewhere.
I'm not sure the requirement for parentheses is intentional but maybe necessary as part of other things?
It's a minor nuisance but might be needed to differentiate expressions from attributes?
Most helpful comment
Great, this also seems to work:
I would like it if this change in behaviour could be documented somewhere.