If you enjoy packaging then this OS is for you.
No, it isn't. The required directories are /, /dev, /tmp. The reqired files are /dev/null, /dev/tty, and /dev/console.
https://pubs.opengroup.org/onlinepubs/9699919799/ chapter 10
Since shebangs have no native way to look up binaries from your PATH scripts should be including the full path to the binary from /nix in the shebang (and they should stop opening PRs asking people to switch to /usr/bin/env for them)
>but bash's location already varies across distros
It almost always exists in both /bin/bash and /usr/bin/bash via a symlink.
>NixOS's choices there are fundamentally correct
I suspect the choice has more to do with that they don't want to do the work needed to remove /usr/bin/env.
Or something heavier like `steam-run`
Packaging for nix isn't as hard as it might seem so I've found it easier just to do it the 'right' way.
The other bit is documentation
The insanely steep learning curve, for something that manages packages. Nix will never take off until you ditch the DSL and get documentation in shape. Otherwise Nix will continue being a system developed by very smart engineers for very smart engineers.
I think the UX problems with Nix are well documented and understood. The developers behind it just need to focus. For that focus to take place, the project needs to be placed under better stewardship.
> WONTFIX
Link to GitHub issue, please?
1. Macbook setup via nix-darwin + home-manager. Now that I've put in the time, I'm going to use it for my personal and family laptops. I would probably not recommend anyone else do this if they have not previously used Nix. Very high ramp given the benefits.
2. Dev environments[1]. I started using nix+direnv for my side projects. This was quick and easy to get started with and has been great. Would recommend anyone look into it via the link below.
I have not tried installing/using NixOS.
It's like Nix-Darwin but without any setup issues, spared from breakage related to OS upgrades, but also with fewer escape hatches (Flatpak is the main easy one it does provide, also steam-run) for app installation. If you do enjoy Nix-Darwin once you get it going and you at least somewhat enjoy Linux desktops, you'd probably enjoy it as a daily driver.
I would say that for users new to the Nix ecosystem, NixOS on a spare machine is the most gentle and pleasant way to introduce the module system and declarative Nix config. It tends to be smoother than Home Manager or Nix-Darwin, and it's a lot more complete than either, both because it has more users. But a spare machine is a good choice for those who aren't yet sure that they like or care about Nix, because if something is missing or non-obvious, the only way out is through— you have to dive deep.
NixOS is so mature these days compared to when I first picked it up, though. Packaging work just to get by on the day-to-day is way more rare, and there are a lot more examples around. A Linux hobbyist who is prepared to struggle a bit can definitely just dive right in and have a good time, for sure.
If you are using nix-darwin to set up your macos, I'd be curious to hear about your experience.
I personally use Nix for having a consistent dev environment for my projects.
I think this shows some things nix enables: https://youtu.be/6Le0IbPRzOE
Around 14 minutes in author is starting doing live demos.
I've been forcing myself to get into NixOS. The idea is great. The Nix expression language isn't hard. I like the immutable root and generations (snapshots).
Setting up a desktop environment or Window Manager is quick and easy. Applications selection is great and you can install different versions in parallel.
The biggest problem for me is on the driver/hardware suppoet of my 2022 gaming laptop. Suspend, sleep, hibernate can be finicky. The graphics driver can also be hit or miss.
Documentation can be better especially for the NixOS exclusive behaviors. The Nix configurations needs more details as to what it exactly does and the packages it pulls. The Arch wiki and other Linux docs can cover the general stuff.
When I was in college, I discovered that reading in different genres (mathematics textbooks, philosophical papers) was a different skill than reading in general. I had to kind of get a feel for certain specialized genres and styles, and after I did, it gave me an ability to read them much faster than I could when I started.
As a Linux hobbyist, I learned that a huge part of feeling at home on the CLI was learning how to explore an environment at the command line, and the tools available for doing that: man, info, --help, tldr, bro, apropos, whatis, etc. Learning how to use completions and my own shell history to recall and mentally reinforce commands, even if I'd only ever used them once before was a big thing. Learning a new command takes me a hell of a lot less time now than it did when I was kid.
The Nix ecosystem is a little bit like that. The resources you can find on nixos.org are good, and you can get by with just them and some manpages, but it'll be slow at first. As you spend more time with Nix, you get a sense of what order to consult the official docs in and what unofficial resources are worth looking at. You now how to read Nix code and can quickly find examples or answer questions just by grepping through Nixpkgs. You gain enough background that it's easy for you to ask useful questions on Matrix, IRC, or Discourse. And the time it takes to learn something about the Nix universe that's totally new to you goes way down.
If you go into Nix with an eye out for resources and methods of learning like that, I think you'll get your bearings more quickly. If you make a reasonable effort to ask good questions and you're patient, you'll also get a lot of good help.
Parts of the Nix ecosystem are and will stay frustrating. But for me, it was totally worth it.
Once you've had a taste, using anything else will feel like poking your hard drive with a stick.
Also:
NixOS: Be the distro maintainer you never wanted to be.
I've even switched away from zfs to btrfs because anything not in-kernel is a constant pain. However, it's worth getting compatible hardware (OSS friendly) for the benefit IMO. It's my daily driver on a frame.work laptop.
I have tried multiple orchestration options before, but they always fail in some way, ansible for example always work until I have to run something from scratch, then it fails miserably because of something that changed after the 20th time I've ran the script. On Nix, that's not even a consideration.
I boot to a tmpfs root so all my changes are ephemeral unless I deliberately save them, it's a fresh install on every boot.
0: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
How does NixOS compare to the usual way of doing this, which is to manage your personal computer with Puppet, Chef, or a similar tool?
That's not to say nix is bad. But NixOS definitely is.
Indeed! NixOS is for people who are done distrohopping. It's for people who see through the superficial differences between distros and realize that their most essential differentiators are their own tooling (package managers, initial ramdisk management system, init system, etc.), and that the massive landscape of distros actually boils down to a handful of configurations in terms of those key choices, with some defaults lightly sprinkled on top.
Once you reach that point in your Linux journey, you generally don't care very much about those defaults, and what makes a distro interesting or appealing is a solid foundation that suits your preferences. The rest is easy to swap out or modify to your liking.
> If you want to embrace the fragmentation in linux and make it so no dev can ever expect a consistent set of libs, NixOS is for you
Indeed, NixOS is not a platform designed to serve as a ready-made target for proprietary software that wants to just make assumptions about what is present and hope for the best. But it does support Flatpak, Podman, Docker, Steam, etc., for devs that want to distribute software that targets some other such runtime instead of distributing source code.
> If you want to [...] set up a custom environment [...] every time you want to run something
The above is massively exaggerated, but kinda yeah. Years before I took up NixOS, I learned how to package software for a few distros and developed some tooling preferences. I realized that with some basic packaging skills, I could run any system I thought was interesting, stable, or useful and just package what is needed along the way. So when I came to NixOS, occasionally having to package things was not a big problem for me. Such users are a great fit for NixOS, and the NixOS community has a lot of them.
How so? Nix gives packages whatever libs they ask for just like any distro
On another distro, that would be at least a day of work lost setting up stuff.
EDIT: lol I've replied on the wrong comment, at least it's the same author...
"All the fun of Haskell and dpkg!"
am I doing this right?
I can't imagine going back (and might give up computers to live in a tree if I had to), but I don't really try to ~convert people who aren't ready for it.
I'll share if I suspect someone is ready, or if I see them struggling on something it ~solves. I might lend a little time helping them bootstrap a basic environment for a project so that they can see benefits upfront.
But I want them to sell themselves on it. This is mostly because Nix is a bit of work, and I feel like slowly selling myself on its vision by reading different articles circa 2015-2017 was an important precondition for succeeding when I finally decided to take the plunge after my previous Windows system flamed out in early 2018.
One friend of mine has recently taken up Nix with a lot of enthusiasm, and by far the moments that have driven him forward the most were his own successes with his Nix-based projects. I've definitely hyped it up before in front of him, and I've definitely helped him along a couple times. But over and over, it's been actually using a capability that was new to him that got him worked up and excited to try more new things.
Can you build/test/run your organization's software from 5 days/months/years ago - across multiple platforms, systems, and ecosystems - reliably?
Can you develop, build, manage, and maintain your software without fear?
Do you want a system do the bookkeeping for proper software dependency management? Or do you want people to do it by hand?
Do you want a declarative system, or try to remember and keep track of all the changes you've ever made by hand?
You don't get these things for free, but if you value them, then Nix is the tool for you. Or at least learn about it so that you can learn from the decades of accumulated knowledge.
next 30 seconds: I can confidently compile and run multiple incompatible versions of software simultaneously. I can build projects from years ago. I can package large projects from different ecosystems (python 2/3, c/c++, go, Javascript, Octave, Rust) and be confident they will not interfere with each other. I can try bleeding edge software with no risk to it interfering with my system. It is faster and less hassle than juggling various Docker containers and VMs. It protects me from dependency hell. Using Nix to manage an operating system (ie: NixOS) then gives me those benefits for my entire machine. Then I get even more benefits when using Nix on any other (not even necessarily NixOS) machine by pushing around package closures and managing a simple binary cache.
But overall: it makes me more productive. It is my secret weapon to manage the complexity of software development. The benefit is not on day 1, but on day 100 and day 1000.
Computers nowadays are a writhing complex mass of components that change and crumble from beneath your feet when you're not looking. NixOS makes your computers predictable and manageable again. It gives you the power to set your preferences and solve your problems in a more durable way than ever. In doing so, NixOS also makes getting things right feel worthwhile when you might otherwise be inclined to just live with and adapt to brokenness. NixOS makes computing fun again, and puts practical configuration management, even on desktops, within reach for lazy home users.
Nix: Portable, predictable development environments that are fast, native, and don't ask you to fuck around with port forwards or bind mounts. Nix is insanely fast compared to Docker Desktop, and provides easy access to an extraordinarily massive collection of packages (80,000+!). If you develop on Mac and Linux and deploy to Linux, there's no better way to distribute your software or its dependencies internally than with Nix, period.