Live data from Hacker News

NixOS 22.11 “Raccoon”

nixos.org

91–100 of 201 posts

Re: NixOS 22.11 “Raccoon”

#91

Earlier quoted context omitted.

Does Silverblue still support traditional package managers? An immutable OS seems nice and I like Bubblewrap's isolation, but I would never switch full-time to an all-Flatpak distro...

In addition to the sibling comment about layering, this is largely what toolbox is for. Essentially you create containerized environments with a lot of integration (you can run GUI apps from them) and install whatever you want in those. toolbox create new_dev_env_or_whatever toolbox enter new_dev_env_or_whatever dnf install all_the_things And now you've got a container with whatever installed. To use it you do have t…

Interesting, that's much better than what I assumed. NixOS' composition tools are fairly similar, at least in scope.

Re: NixOS 22.11 “Raccoon”

#92
post #10

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 would expect something like Steam gaming on my dual-GPU laptop might be one deep mineshaft of "nope" on NixOS.

I can't speak to that specific use case, but in a more general sense...

NixOS, just like any other OS, can have you walking down the familiar caverns of, "getting the thing to work that this system isn't designed to accommodate well."

But this time is different: you can start over fresh at any time.

This is really the situation where NixOS shines the most. No more, "wondering what you installed where when you were trying to get that over program working the other day." No more, "did I just do the steps in the wrong order?"

It's unbreakable. Your OS is guaranteed to feel like a fresh install. Forever. Because it can't be anything else.

Re: NixOS 22.11 “Raccoon”

#93
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…

Nix the language enables you to write explicit build recipes that can be reproducibly built with good integrity guarantees and granular and distinct knowledge of the build-time dependencies and the run-time dependencies (so you only ever transmit closures that have what they need to execute).

Nix the set of tools gives you convenient command line tools that can: evaluate Nix language expressions, build recipes, analyze build-time or run-time dependency graphs of a recipe, give you ephemeral shells with the packages you want in scope but not installed "globally", package management tools to install packages globally, and recipe diffing tools so you can see how recipes changed.

Nix the package manager is a convenient, gigantic, community effort to explicitly describe how to (reproducibly) build almost all of the OSS software that users need and it comes with a substitution cache so that most recipe build products are easily substituted when installing, so you don't have to build. Even if you don't use Nix, nixpkgs is still impressive because you have the most explicit documentation for how to build a piece of software from source and all of its dependencies than anywhere else on the internet, it usually rivals project author's in its specificity, explicitness, and clarity.

NixOS the Linux distribution combines all of this together with a convenient configuration module system and generally good defaults to give you an operating system that is declaratively specified from your etc hosts file all the way down to the recipe for building the kernel, a rich and granular dependency graph, reproducible OS configuration builds, and diffs between closures.

My biggest gripe with Nix is the lack of static types. This was the originator's biggest mistake that Nix will be living with for a very long time to come. Static types would have helped bring the learning curve down IMHO and made it easier to document and less frustrating to debug.

That being said, the overall properties of Nix, nixpkgs, and NixOS far outweigh the pain points in my six years of production experience with it and for what we care about: auditability, reproducibility, explicitness, efficiency, and integrity.

Re: NixOS 22.11 “Raccoon”

#94

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.

It would be nice if you could just install python packages with pip in a venv and ignore nixpkgs python packages, but then some things like e.g. pyqt5 actually have some extra dependencies on system libraries, so you pretty much need the nixpkgs version to get it to run https://nixos.wiki/wiki/Packaging/Quirks_and_Caveats#ImportE... and if you want to keep using the venv for the other packages (e.g. because they aren't in nixpkgs) you might try initializing with "python3 -m venv --system-site-packages" to make the nixpkgs pyqt5 visible in the venv, but for some reason venv/bin/python3 ends up pointing to the wrong python, so I currently resort to "ln -s $(readlink -e $(which python3)) venv/bin/python3" ...

If there's some easier way, I'm eager to hear about it.

Re: NixOS 22.11 “Raccoon”

#95
post #14

Earlier quoted context omitted.

No, that works fine. As well as it ever does.

Really? I'm curious to read more. It works very well for me under Ubuntu these days, but if I can get it working equivalently well on NixOS I may legitimately consider switching.

I use steam on nix and it was a breeze.

Re: NixOS 22.11 “Raccoon”

#96

Earlier quoted context omitted.

Seconding this. I ran Silverblue until recently due to some bugs in Kinoite but switched as soon as possible because GNOME sucks. Its the first distro I've used in 20 years that doesn't feel like a stiff wind could cause the whole thing to collapse and catch fire in an unrecoverable way, while still allowing me to run any software I want instead of just what is in some limited curated repo. And unlike Nix, I didn't n…

Does Silverblue still support traditional package managers? An immutable OS seems nice and I like Bubblewrap's isolation, but I would never switch full-time to an all-Flatpak distro...

Yes, you use 'rpm-ostree' to install and manage regular dnf packages, or local .RPM files.

The limitations are:

1) Each invocation of the package manager (install/upgrade/uninstall, the usual stuff) results in a new OS 'commit' and requires a reboot to switch to it.

This is the entire point of the distro (random .rpm broke your system? just rollback), and is why Silverblue users generally only use DNF packages for low-level tools and run regular applications as flatpaks, appimages, or podmans.

2) Occasionally you'll run into a package that wants to write to a folder that Silverblue made read-only and version-controlled, and breaks. In that case your only options are to run the package inside a toolbox (a special Podman container that comes with Silverblue for these scenarios), or patching the package.

Re: NixOS 22.11 “Raccoon”

#97
post #88

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?

Nix feels to me like a cool but somewhat hacky v1 of a really great idea. I'm hoping someone creates a much more elegant successor. If Nix is CVS or even Subversion, I'm hoping for Git.

The neat thing about the functional design of Nix is that you don't have to reinvent the wheel: just make better steering.

Everything about Nix can be trivially refactored. Every part is neatly isolated from the rest.

Re: NixOS 22.11 “Raccoon”

#98
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.

While maybe not impossible, it is quite hard to cox Nix to "install" multiple different versions of the packages. They all cannot be in your path at the same time.

I still encourage you to give it a try. You can build different versions of same package and not "install" them. Instead just execute the binary from the built version (I do this where I have a built-but-not-installed version of openssh-8.6 laying around because I have an old service that modern SSH no longer supports).

You can also run `nix-shell -p ` to get a shell with a specific package available in the path, overtop of whatever might be globally installed.

Who knows, you might even be tempted to dip your toes into the Nix language by writing a custom `shell.nix` to build a shell with some more complex development environment, or to simply automate a complex `nix-shell -p` command.

Re: NixOS 22.11 “Raccoon”

#99
post #58

Earlier quoted context omitted.

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.

> nixpkgs is already one of the largest package collections. There is a good chance your software is already included. Yes, but that still doesn't solve this: > Major problems: installing niche proprietary software that you may have to package yourself If some software _isn't_ packaged, it's a pain in the butt to get it running on NixOS. Either you have to create Nix derivations, which have a pretty steep learning cu…

I run NixOS, but I'm relatively new to Nix. A couple weeks ago I was trying to get an old vanity key generator to build because it wasn't on nixpkgs (vanitygen++) and on a lark I decided to write my own derivation using some examples of similar C++ packages I found and figuring out what nix packages it needed to build. So I did, and the maintainer accepted the PR: https://github.com/10gic/vanitygen-plusplus/commit/7bcee06f3... Note that I am not a C++ developer and only know the basics about how to get C/C++ things to build.

So what does this get us? In theory, this is now trivially-buildable on any distro that has nix installed, or on nixos. I haven't converted it to a flake yet (still learning that) but if I (or someone else) did, it would be deterministically reproducible anywhere on nix.

I agree that there's a learning curve on figuring out the "recipe" for a thing, but once someone does that work, it's basically done forever. Which is a promise that no other system can even approach.

And once you figure out a certain amount of it, this moment will come where you realize you want every system you deal with to be Nixified. Like the guy elsewhere in this thread who rebuilt his own router using NixOS and loves it.

Getting new developers up to speed in your shop's dev environment? Completely trivial to do with Nix. Getting a machine back up after a failure? Reinstall NixOS and reapply the config you were using (which is in source control). Upgraded Gnome and some things you need broke? Or updated your GPU driver and now your screen just shows black? Simple... Roll back in the bootloader to a previously-working config, then undo your changes to the config definition.

Have 10 different projects all with different dependencies and version requirements that would normally collide with each other? Trivial, each project has its own default.nix file and Nix can drop you right into that environment while you're working on those projects.

NixOS (and very honorable mention to Guix) are in fact the only ways to run Linux while keeping your sanity intact!

Post reply on HN