News for hackers. Stuff that matters.
Re:My NixOS Desktop Flow by pkulak on Sunday April 26, 2020 @02:12PM (#22988925)
> That and the ability to install a package in a shell, use it, then exit the shell and not have it installed globally is amazing.

I can't even count the number of packages I have installed because I needed them once. I have an entire Node.js ecosystem installed because I needed to run a frontend from another team for 20 minutes. Could I have done all that in a single shell, then had it automatically cleaned up when I was done? My current solution is to spin up a container, but that becomes a pain and I end up getting lazy and just globally installing everything again.

Re:My NixOS Desktop Flow by onlydnaq on Sunday April 26, 2020 @02:37PM (#22989102)
> Could I have done all that in a single shell, then had it automatically cleaned up when I was done?

Yes, that is a pretty standard workflow for most nix users. You either set up a shell.nix for your project with all of its dependencies, or if you need a certain tool once you just write for example: ‘nix shell -p iotop’ to enter a shell where iotop is in the path.

Re:My NixOS Desktop Flow by pkulak on Sunday April 26, 2020 @02:40PM (#22989130)
Wow, that's pretty great. I'm gonna spin up a Nix VM shortly, see how it goes.
Re:My NixOS Desktop Flow by eptcyka on Sunday April 26, 2020 @05:33PM (#22990450)
Certainly. You'd be just a `nix-shell -p nodejs` away from being in a shell with NPM. And a C^D away from not having it installed, with a caveat that it would be cleaned up periodically and not immediately after exiting the shell. But I think there's an option for immediately removing after use as well.
Re:My NixOS Desktop Flow by MarcScott on Sunday April 26, 2020 @04:08PM (#22989785)
Yeah, you can just have a couple of config files and spin up a shell that auto-installs everything. The packages are all on your system, so the next time you start the shell, nothing has to be downloaded, but they're not installed globally, and a you can do a garbage collection command at any time to clean up everything.

When I first started using NixOS I had a huge list of globally installed packages, but that has become smaller and smaller over time. For instance, my main browser is Firefox, which is installed globally, but if I need to use Chrome, then it gets fired up in a temporary shell.

Re:My NixOS Desktop Flow by karatestomp on Sunday April 26, 2020 @03:16PM (#22989391)
I haven't used it in a while but Vagrant used to be great for "setting this up with apt and the language's package manager would be straightforward, but containerizing it would be a pain" one-offs, to keep it off your base system. And didn't require you to keep an entire image around to do it again, just the vagrant config file.