4 ms·
I'm no Linux expert. I used Ubuntu for a few years and then switched to NixOS a couple of years ago. Setup is no more difficult to Arch, and certainly a lot eas
by MarcScott 6y ago
I'm no Linux expert. I used Ubuntu for a few years and then switched to NixOS a couple of years ago. Setup is no more difficult to Arch, and certainly a lot easier than Gentoo.
For me the fact that I can replicate my machines with a couple of config files is the major driver. 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.
Of course, you can use the nix package manager on any Linux distro and even macOS if you want a gentler introduction.
- pkulak 6y ago> 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.
- onlydnaq 6y ago> 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.
- pkulak 6y agoWow, that's pretty great. I'm gonna spin up a Nix VM shortly, see how it goes.
- karatestomp 6y agoI 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.
- MarcScott 6y agoYeah, 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.
- eptcyka 6y agoCertainly. 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.
- kylek 6y ago>> ... and not have it installed globally is amazing. Yah, the more I think about it this is the biggest selling point to me. >> Of course, you can use the nix package manager on any Linux distro and even macOS if you want a gentler introduction. I actually never thought deeply into nix NOT on nixos (I've probably been conflating the two). As an infra/devops-y person I can think of a lot of cool use cases off the bat in the server-space (theoretically anyways, I've a feeling the details would be quite the devil). But, except for the case of developing for such a system, I'm struggling to see a use case that warrants it in the desktop realm. (I need to meditate on this one..!)