3 ms·
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?
by drbaba 3y ago
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?
- Melonai 3y agoJulia 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/ https://jvns.ca/blog/2023/02/28/some-notes-on-using-nix/
- akvadrako 3y agoHe obviously wasn't looking for some random blog. The point is Nix has no polish for people who have things to do.
- turboponyy 3y agoSorry 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 https://github.com/nixos/nixpkgs). The available inputs are configurable (again, either through NixOS, home-manager or the package manager's standalone configuration).
- drbaba 3y agoThanks for getting back to me with some detailed examples! This looks quite neat :)