Live data from Hacker News

Pkgx – “Run anything” from the creator of brew

pkgx.sh

61–70 of 71 posts

Re: Pkgx – “Run anything” from the creator of brew

#61
post #36
post #30

Earlier quoted context omitted.

Do you have a link to where I can read about using Nix as purely a package manager? Or a minimal example showing how a Nix config looks if used in this manner?

Julia Evans has an article pretty much about what you’re asking for! I think looking at nix-shell for getting some things into PATH temporarily would also be quite useful, although Julia deliberately left it out of the article. It’s just as simple as running `nix-shell -p pkg1 pkg2` if that’s all you want to do with it! https://jvns.ca/blog/2023/02/28/some-notes-on-using-nix/

He obviously wasn't looking for some random blog. The point is Nix has no polish for people who have things to do.

Re: Pkgx – “Run anything” from the creator of brew

#63
post #50

Earlier quoted context omitted.

“Minutes” seems an awfully small rebuttal to be quite honest. I’ve never had to install a brew package under duress.

When I issue a `brew install package` command, I expect it to either install the package or fail installing the package, and not do something else entirely. Sometimes I need to do something quick, nix-shell has never given me any issues with that. Brew has taken 10 minutes before getting to the install process. It's severely annoying.

By contrast, other package managers just don’t update thing. You end up so out of sync it becomes a massive pain.

Re: Pkgx – “Run anything” from the creator of brew

#64
post #7
post #5

I know I'm a Nix elitist but I really don't understand why people don't just use Nix for all their package management.

Probably the EVE Online-like learning curve.

Similar spirit to “why doesn’t everyone just use vim it’s so powerful”

Re: Pkgx – “Run anything” from the creator of brew

#65
post #50

Earlier quoted context omitted.

When I issue a `brew install package` command, I expect it to either install the package or fail installing the package, and not do something else entirely. Sometimes I need to do something quick, nix-shell has never given me any issues with that. Brew has taken 10 minutes before getting to the install process. It's severely annoying.

By contrast, other package managers just don’t update thing. You end up so out of sync it becomes a massive pain.

I can fix the pain when it comes. Brew is already slow, I don't need it to become slower still.

Re: Pkgx – “Run anything” from the creator of brew

#66
post #13

Earlier quoted context omitted.

The docs could be better, but it's as easy as: 1. Install Nix from https://nixos.org/download.html 2. Find the package from https://search.nixos.org/packages 3. Start a shell with `nix-shell -p `, have the package available in it

Or even better, install it using the installer from Determinate Systems.

Its not really an argument for the tool if the solition is download another tool to wrap it.

Re: Pkgx – “Run anything” from the creator of brew

#67
post #35

Earlier quoted context omitted.

Yea but ”fuck” just autocompletes your misspelling Pkgx installs and executes what you want.

Zero System Impact We don’t install packages. We cache them.

You’re right! Bad choice of word from me.

Re: Pkgx – “Run anything” from the creator of brew

#68
post #30

Earlier quoted context omitted.

You don't need to learn the DSL to use Nix as a package manager.

Do you have a link to where I can read about using Nix as purely a package manager? Or a minimal example showing how a Nix config looks if used in this manner?

Sorry for the late reply!

I'm not sure why you think there is any 'config' involved. Perhaps you're conflating Nix the package manager with NixOS? Nix is many things, but it's also just a package manager like any other. For example:

    nix profile install nixpkgs#vim # installs a package into your environment

    nix shell nixpkgs#binwalk nixpkgs#vim # drops you into a shell with the given packages

    nix run nixpkgs#firefox # runs the mainProgram of the given package


A couple of things to note:

The aforementioned commands are the "experimental" Nix 2.4 CLI commands that integrate with Nix Flakes. They are only experimental in name though, their status of being experimental being sort of a meme at this point. I recommend using these new commands (you can opt in by supplying a command-line flag or by tweaking the package manager config).

Packages that are not in active use (e.g. packages that you've referred to in 'nix shell' or 'nix run' invocations that are not installed using 'nix profile') are due for garbage collection. The garbage collection settings can be configured (either through NixOS, home-manager or the package manager's standalone configuration). The garbage collection can also be triggred manually. This makes experimenting with programs that you don't necessarily want to keep a joy.

The 'nixpkgs' in the aforementioned invocations is a default input that is set during installation. It refers to the nixpkgs package archive's flake's master branch's latest revision (https://github.com/nixos/nixpkgs). The available inputs are configurable (again, either through NixOS, home-manager or the package manager's standalone configuration).

Re: Pkgx – “Run anything” from the creator of brew

#69
post #30

Earlier quoted context omitted.

Do you have a link to where I can read about using Nix as purely a package manager? Or a minimal example showing how a Nix config looks if used in this manner?

Sorry for the late reply! I'm not sure why you think there is any 'config' involved. Perhaps you're conflating Nix the package manager with NixOS? Nix is many things, but it's also just a package manager like any other. For example: nix profile install nixpkgs#vim # installs a package into your environment nix shell nixpkgs#binwalk nixpkgs#vim # drops you into a shell with the given packages nix run nixpkgs#firefox #…

Thanks for getting back to me with some detailed examples! This looks quite neat :)

Re: Pkgx – “Run anything” from the creator of brew

#70
post #7

Earlier quoted context omitted.

Probably the EVE Online-like learning curve.

Similar spirit to “why doesn’t everyone just use vim it’s so powerful”

Unironically, yes. I guess this is why I'm an engineer, and not a PM.
Post reply on HN