- cross-posted to:
- linux@programming.dev
- cross-posted to:
- linux@programming.dev
One aspect of Guix I found to be really fascinating: That there is basically no conceptual difference between defining a package as a private build script, and using a package as part of the system.
Let me explain: Say you wrote a little program in Python which uses a C library (or a Rust library with C ABI) which is in the distribution. Then, in Guix you would put that librarie’s name and needed version into a manifest.scm
file which lists your dependency, and makes it available if you run guix shell
in that folder. It does not matter whether you run the full Guix System, or just use Guix as s package manager.
Now, if you want to install your little python program as part of your system, you’ll write an install script or package definition, which is nothing else than a litle piece of Scheme code which contains the name of your program, your dependency, and the information needed to call python’s build tool.
The point I am making is now that the only thing which is different between your local package and a distributed package in Guix is that distributed packages are package definitions hosted in public git repos, called ‘channels’. So, if you put your package’s source into a github or codeberg repo, and the package definition into another repo, you now have published a package which is a part of Guix (in your own channel). Anybody who wants to install and run your package just needs your channel’s URL and the packages name. It is a fully decentral system.
In short, in Guix you have built-in something like Arch’s AUR, just in a much more elegant and clean manner - and in a fully decentralized way.
This is true for Nix as well.
The two main advantages of Guix are the language (which is well-known and comes with lots of good tooling and other support) and the package bootstrapping.
The main disadvantages I’ve faced when trying it a few years ago:
At the time it was a great concept, but essentially useless for anything not Emacs/Haskell related.
It’s very easy to add additional channels and non-official channels integrate pretty well into everything. I don’t really notice if a package comes from an “official” channel or “non-official” channel.
I didn’t like using AUR when I ran arch, let alone some random repo with absolutely no oversight.
https://toys.where-is.social/
Find different channels and substitute servers or create your own
Address not found.
Also, it doesn’t change the fact you’re depending on some random person’s repo that is not moderated in any way.
Yep. I feel like Guix is surprisingly awesome and polished in a couple places, but mostly it’s a very DIY distro, much more so than even NixOS.
Yeah. See, drivers are part of the hardware abstraction layer which in a Linux system is the Kernel. The kernel is GPL, so it is hard to get support for hardware with drivers without GPL, it does not conform Linux’ license.
I, too, had also nothing but hassle with an NVidia graphics card in Debian. It was a happy day when I finally ditched it for a supported card and had a fully supported system!
The other thing… let’s turn the question around. Would you:
If not - why do some people expect equivalent things from free software projects?
It’s a violation that’s not enforced, as almost all distros provide proprietary blobs. They balance ideology with usability, since they realised most people aren’t going to use a librebooted ThinkPad from the 90s. If everyone enforced libre purism like GNU, desktop Linux would’ve been completely dead long ago. If you need proof, check usage statistics for any of the free distros.
And did you need to install a modified iso to have WiFi? Did maybe Debian provide those nvidia drivers?
How is any of that relevant? This is not a question of additional software or services, but basic usability. Guixos as is, is for example essentially useless on a laptop unless you’re willing to carry an external WiFi card in your pocket.
The only expectation I have for an OS is to work on my devices, guixos does not. And even when I jumped through all of the hoops to get it working, I still needed to use nix to install most packages I need to work. So why would I use guixos+nix+flatpak instead of just running nixos?
So maybe Guix System is not a good choice for you?
It has top-priority goals like reproducibility, capability to inspect and verify all source code, and providing a fully free system. These specific goals are not compatible with providing nonfree binary blobs in Guix-core. For example, depending on non-free binary blobs will block exactly reconstructing a system years later if these binaries are not available any more. Guix has scientific applications where reproducibility absolutely matters.
Also, I can unterstand if companies are hating it which just want to have a free ride and monetize efforts of other people. But for users, there are many many other options and distributions available. Why not chose one that matches your need better?
Why get mad about people comparing nix and guix, in a thread comparing nix and guix? Pointing out legitimate disadvantages is not hating. Maybe get off the internet for a bit and touch grass.
So does nix, nobody is forcing you to opt-in into non-free packages. And guix most certainly is compatible with non-free blobs, as that’s how most people are using it. The only difference is that nix is supporting non-free packages instead of banning even talking about them.
I am not sure about that one and somewhat doubt there is hard data showing that.The 2024 user survey also shows that a lot of people are using Guix as a package manager on top of another distribution, like Arch or Ubuntu or even NixOS. . If you have hardware that is not directly supported, this fixes the driver problem.This
I use Guix as my “default” distro because I value software-freedom and reproducibility. It fits my needs very well, and I make sure to buy hardware that works with it instead of expecting it to work with whatever I throw at it. For my Windows gaming machine I use PopOS as the replacement OS instead of trying to beat Guix into serving that purpose, because PopOS is better suited for that role, and I have different expectations for it.
It’s okay if something doesn’t meet your needs, that doesn’t make it bad, just means it’s not the right thing for you. There’s like hundreds of distros for Windows gamers, let us free software zealots have ours too please.
This is the way. Trying to get unsupported hardware to work under Linux in general is such a useless expense of time. In my experience, it is almost never worth it.
1,000 times this.
looks at laptops with hidpi displays 👀
I wouldn’t call that an advantage for the average person. Nix is far nicer to work with. Some Lispers might disagree, but I, for one, can’t exactly see the beauty in trying to turn Scheme into a configuration language with macros and hacks. Also Guix puts Scheme everywhere, things you can do with plain old Bash in Nix, you’ll have to all do in Scheme in Guix, so there is a much steeper learning curve.
Well, Nix language is also full of hacks, idiosyncrasies and stupid decisions. I say that as someone who’s writing it “professionally”, i.e. as part of my job. Scheme is way less “unexpected”. But there are other parts of Guix which are pretty weird or just bad, like the “channels”/“pins” management situation.
Bash is not a advantage, it’s a disadvantage
You prefer:
over:
postInstall = '' rm $out/lib/basic-server $out/lib/helloworld $out/lib/postcollector ''
?
Bash code should definitely be
rm -f "$out"/lib/{basic-server,helloworld,postcollector}
Yes, having programmed bash and its predecessors for 30 years and several lisps (Clojure, Racket, Guile, a little SBCL) in the last 15 years, I very much prefer the Scheme version in this place.
Why?
'echo a; rm -rf /etc/*'
.(And don’t get me wrong, Unix shells are great if you want to save on extra keys pressed in a terminal session. But there are reasons that the shell languages are not often used in larger programs.)
I agree with your overall point, that having a single consistent functional language for package descriptions and build scripts is a great thing, and that bash is awful, but your reasoning is somewhat flawed. The main drawbacks of bash are somewhat rectified in Nix because bash is very much contained/sandboxed, which prevents arbitrary damage to the system, and there are some nice defaults in stdenv too.
Nix also supports multiple outputs (in fact this is where the concept of outputs in Guix came from)
You could also do that with Nix in an easier and more declarative fashion, either by adding a comment, or by doing this:
Bash is just two double quotes away from doing this too. See code above for an example
Bash also handles Unicode well
Nixpkgs stdenv sets
set -eu
which has a similar effect. If that code fails, the entire build will fail too.This is also really quite easy to rectify in bash, see code above.
Scheme is a minimalistic Lisp dialect, and macros are central in Lisp. For example, they allow for both conditional evaluation (“if” is a macro, or more precisely, a “special form” that is used in other conditionals), and for delayed evaluation at run time, which matches a bit Nix being lazy.
Also, Scheme is designed as a not strictly but mostly functional language, favouring side-effect free functions, which matches well with the declarative task which is package definitions.
bash, in contrary, is not side-effect-free, it modifies its environment, and this is very much not desired in a functional package manager: it is at the core that package declarations are side-effect-free.
And Emacs shows that Lisp written in a declarative style is a superb configuration language. (There is now even a project to use a Scheme, Steel Scheme, to configure helix, a programmers text editor which has many many features stemming from vim!).