4 ms·
nix-env is a little worse than your examples suggest. It's really: nix-env -iA nixpkgs.package_name Can't forget the leading `nixpkgs.`. And searching is:
by ianthehenry 5y ago
nix-env is a little worse than your examples suggest. It's really:
nix-env -iA nixpkgs.package_name
Can't forget the leading `nixpkgs.`. And searching is:
nix-env -qaP '.*keyword.*'
Because `--query` takes a regex -- unlike all of the other nix-env subcommands, which take globs.
But `nix search` has been available for years, and works great.
There's still no nice interface for installing packages, but that's not actually an operation you do very often with Nix, since you're mostly specifying environments in files, rather than mutating your own user environment. Of course, newcomers don't know that, and they want to manipulate things in their PATH like every other package manager, so that's not an excuse for the bad ergonomics. The upcoming version of Nix adds `nix profile install` which is a bit more intuitive.
I think Nix's current CLI makes git look positively humane, but I'm encouraged that it's been steadily improving.
- dmitriid 5y agoHeh. Just came in to say that when I saw this: > You can search the package list using: > $ nix-env -qaP git I immediately said to myself "nope, not going to use this". For some reason unbeknownst to me developers think that CLI must be as inscrutable and cryptic as possible. You don't have to leak your tool's internals everywhere to provide a reasonable `nix search package-name`
- kaba0 5y agoNix search package-name does work actually. These are the older CLI tools and there is WIP for a newer interface.