Live data from Hacker News

NixOS 22.11 “Raccoon”

nixos.org

111–120 of 201 posts

Re: NixOS 22.11 “Raccoon”

#111

I might want to try some new Linux distribution so I wonder: what doesn't work in nix? What are its weaknesses? What about devices with non-free firmware?

I'm just going to link to the best HN comment I've seen on this topic

https://news.ycombinator.com/item?id=33679621

Re: NixOS 22.11 “Raccoon”

#112
post #63

I might want to try some new Linux distribution so I wonder: what doesn't work in nix? What are its weaknesses? What about devices with non-free firmware?

> What are its weaknesses? I think is easier to see this with what is their main strength: A declarative/reproducible OS setup. Is AMAZING for server deployment (like what you put in a docker file but that not mutate after it). But I don't think will be so nice for day to day use. That is where a mutation OS is easier.

The biggest weakness is the built-in expectations it has on how packages install/operate. There are some patterns that will not fit into the box easily (e.g. native-compiled gems/node packages).

Also since things are declarative, that means things like e.g. updating bash aliases has additional friction vs the traditional way of editing the file directly.

Re: NixOS 22.11 “Raccoon”

#113

My experience with NixOS: Package installation is usually just from the official channel, system options can usually be done with `/etc/nixos/configuration.nix` and home-manager. Major problems: installing niche proprietary software that you may have to package yourself, and fighting Nix for languages with package manager, e.g. Python, which frequently uses packages not in nixpkgs.

nixpkgs is already one of the largest package collections. There is a good chance your software is already included. The nix language itself is pretty straightforward and if you know haskell your should feel straight at home. You shouldn't use nixpkgs python packages as a replacement for your python development. That would also not work that great on other distros.

I think there are a few problems here:

1. Packaging requires knowing more than just the language, you should also know how files are being linked, what to look for when you got an error. If you only know haskell, you may not know this.

2. If you wrote the correct script, it just works. But if you wrote something wrong but syntactically correct, finding the issue may not be that trivial, in my experience the trace is not very useful.

3. Not sure where the documentation for helper functions is. I think there are unofficial documentation out there but iirc it is not in the nix reference manual?

4. Some python packages with system dependencies will not work when installed through virtual environment. I haven't done serious python development for a long time so I forgot what I usually do to fix it, but I think I just packaged everything in Nix.

5. Some build tools without wrapper (iirc mold, ldd) will cause loader error.

But yeah, I do agree that packaging is not that hard, just require a bit more thoughts than just using typical build instructions and `make install`, and perhaps look at the binaries with ldd.

Re: NixOS 22.11 “Raccoon”

#114

Earlier quoted context omitted.

Can you share your router configs? I'd love to have a NixOS based router.

One drawback I realized about NixOS as a router for home use is that if you need to share administration of the network, then it has to be easy for non-experts. In that case something like OpenWRT might be a better choice.

Well, at least the config file options are relatively straightforward, but you're right in that a GUI makes more sense for genpop

Re: NixOS 22.11 “Raccoon”

#115

How long are we going to sit on our hands and pretend flakes aren't the only way forward? Am I just missing something?

I have not used flakes at all for my NixOS server. To put it one way, why should I care?

(speaking as someone who hasn't actually fully converted over to flakes yet)

Because it actually fulfills the original promise of Nix: Forever-reproducible builds.

Anyone who's ever dealt with a lockfile across any stack that supports that idea in dependency definition, knows how this works and what it's good for.

Re: NixOS 22.11 “Raccoon”

#116
post #23

I might want to try some new Linux distribution so I wonder: what doesn't work in nix? What are its weaknesses? What about devices with non-free firmware?

If you just want someone to shoot you straight: Documentation and naming conventions for Nix are absolute shit across the board. This will get downvotes, and people will say I'm wrong, but I'm 100% right. Go see yourself, it's bad. Language is called Nix, OS is actually called Nix, package manager is called Nix, just the whole thing seems like it was written in 1 week by a squirrel with 12 hands and a sack of ritalin…

"Derivation": A per-package lockfile (that is, a merkle tree of dependencies with the hash of their binaries plus the hashes of any deeper dependencies... think git with its commit hashes) that is computed at runtime when that particular binary is installed or updated. This ensures that it will always run with the exact versions of the things it depends on, and upgrades to sub-dependencies (like glibc, or openssl, etc. etc.) won't suddenly break things, because multiple versions of those can now exist in parallel, since its "name" (with regards to the nix store) is not just the canonical name but the canonical name concatenated with its "commit hash" (as it were, using git language)

so basically, when you install something with nix, it's specified all the way down to the bare metal (except for perhaps the kernel)

Re: NixOS 22.11 “Raccoon”

#117
post #35

Earlier quoted context omitted.

If you want to run nixos (i.e. the linux distro) then the configuration file is written in the nix language. Given that you’ll have to configure your installation, you’ll have to learn the nix language If you just want to use nix for packages, you can run any distro and install nix the package manager into it. This is a good way to dip your toes in the water. And in that case you can just use the cli commands for ins…

I remember reading that nix unlike all other distros can install multiple version of the same package and I want this feature, but I guess programming a package config might be too much for me. Maybe I'll try nix package manager then.

The Nix idioms that are used in configuring NixOS are super simple, mostly just turning things on and off.

You can browse some here: https://search.nixos.org/options

For example, to install an OpenSSH server and run it, you'd write:

  services.openssh.enable = true;
and to run it on an additional port, 2222, instead of just the default of 22, you'd write:

  services.openssh.ports = [
    22
    2222
  ];
For programs you don't need to configure but just want to put on your PATH, you just add them to a list like

  environment.systemPackages = [
    pkgs.firefox
    pkgs.jq
  ];
If configuration management isn't for you, go ahead and mess around with Nix as a standalone package manager. But NixOS really doesn't require much effort or prior knowledge to get up and running and start playing with it!

(For NixOS, the Nix you write only starts looking like real code when you want to add new features or some packages to NixOS.)

Re: NixOS 22.11 “Raccoon”

#118

Earlier quoted context omitted.

Yeah I used to use pfSense but hated having a load of config and firewall rules created manually, it all felt quite brittle. Moved to NixOS almost 5 years ago now and haven’t looked back, my router config is in Git and I’m able to make changes with confidence. Best part is making a change/installing an update and being able to rollback if I mess something up. I also use Nixus to push new configs which has a nifty fea…

I appreciate your comment here, and the parent comment. I've been using OPNSense[0] as my router for the past several months. So far, I am quite happy with it, but I've also thought that NixOS would be the next step. My OPNSense router has 30+ VLANs and many layered firewall rules (my take on "zEr0 tRuSt") and so the task of converting it all to NixOS seems a little daunting. I appreciate the utility of OPNSense's we…

NixOS is great for a basic home router (I use it for my home router) but it’s networking config is still pretty rudimentary, and some things I would expect to work just don’t - i.e. port forwarding only works from outside your network, not inside.

I haven’t done much with vlans yet so I can’t comment on that.

Re: NixOS 22.11 “Raccoon”

#119

My experience with NixOS: Package installation is usually just from the official channel, system options can usually be done with `/etc/nixos/configuration.nix` and home-manager. Major problems: installing niche proprietary software that you may have to package yourself, and fighting Nix for languages with package manager, e.g. Python, which frequently uses packages not in nixpkgs.

nixpkgs is already one of the largest package collections. There is a good chance your software is already included. The nix language itself is pretty straightforward and if you know haskell your should feel straight at home. You shouldn't use nixpkgs python packages as a replacement for your python development. That would also not work that great on other distros.

> .. if you know haskell ..

And if you don't have any FP background you're just.. out of luck. /s

Re: NixOS 22.11 “Raccoon”

#120

I might want to try some new Linux distribution so I wonder: what doesn't work in nix? What are its weaknesses? What about devices with non-free firmware?

I'm just going to link to the best HN comment I've seen on this topic https://news.ycombinator.com/item?id=33679621

No mention of the fucky /nix/store paths for everything? I haven't used a lot of other distros, especially recent ones (my list: Slackware, Redhat, Ubuntu, Debian), but Nix is a drastic departure from the standard FHS and Linux conventions.

Don't get me wrong - I love NixOS! I'm gradually switching my infrastructure to NixOS. There are very necessary reasons for Nix's departures. But it is jarring, and if we want converts we have to manage expectations properly!

Post reply on HN