196 points · by pabs3 · 3y ago · 135 comments
On the other hand, Guile is not a DSL but a general purpose language or a Lisp (Scheme to be exact), so it's not actually a downside compared to a DSL in my view.
I myself am torn between these two. Nix community is larger and they have more packages. Guix, being a GNU project, obsessing over ""non-free"" sure won't help in its adoption. Even debian folks toned down their stance on this, why couldn't Guix do so too?
As a long time contributor to Guix I find that the "obsessing" is regularly done by others when talking about GNU. There's enough useful free software out there that needs packaging, and that's what I do. I don't need the extra headache of special snowflake licenses or custom restrictions.
For nonfree software that doesn't have a popular alternative I contribute to guix-science-nonfree. It's barely an inconvenience for users to expressly add another channel to their Guix installation.
Needing a channel was a huge inconvenience as you would often pull your channels and stuff would break, as guix was updated but non-guix wasn't. Managing channel manifests was a pain. Firefox would often be months out of date as well.
Moved to NixOS, didn't enable allowUnfree, and had an actually up to date and simple to maintain system. Flakes solves the channels problems too. I had put a lot of effort into making Guix work, but it just had too many usabiltity issues, and the policy on firefox was a major one.
[1]: https://github.com/SystemCrafters/guix-installer/releases
As a regular Nix user and occasional Guix dabbler, I think you really can't go wrong either way. I feel that Guix often gets short shrift here on HN, but at the end of the day it's a really thoughtfully designed project with a capable community and great documentation.
No idea what "making NixOS compatible with other programming languages" is supposed to mean. On the face of it the phrase is, well, baffling. Would you care to elaborate?
This keeps getting asked and it's baffling to me. Any programming language can delay evaluation by wrapping values in thunks where that makes sense, so it seems odd to me to give so much importance to whether values are evaluated strictly or delayed by default.
Guix package definitions declare other package values as inputs, and evaluation of these inputs is in fact delayed.
Verbosity: in Guix we don't generally run shell snippets as part of a build; the build phases are compiled into a Guile builder script, so in the absence of helpful abstractions build phases do not generally have the conciseness of shell scripts. On the other hand abstractions are easily fashioned, so some things are more concise and clearer than the shell equivalent.
> This keeps getting asked and it's baffling to me. Any programming language can delay evaluation by wrapping values in thunks where that makes sense, so it seems odd to me to give so much importance to whether values are evaluated strictly or delayed by default.
At least in Haskell laziness increases composability.
I can't think of any examples in Nix, but maybe it's the same reason?
Indeed. I was simply asking whether the macros used for programming Guix are lazy, how is that baffling?
That Nix can't tell what's a package and what's not is a hindrance for its user interface (e.g., it's hard to look up packages by name/version or to iterate over them) and for packagers (e.g., easy to end up with package definitions that don't follow the informal "schema").
(Note that Nix's laziness is not an unalloyed good either, for example it is notoriously difficult to debug. But let's limit ourselves to pure expressiveness for now)
Which isn't fully baked, no, but here's hoping.
Does Guix have anything similar to Nix flakes yet?
nix run github:ggerganov/llama.cpp
Makes it really easy to switch versions, fork, patch or otherwise customize things.[0] - https://en.wikipedia.org/wiki/JSON#Syntax
[1] - Edit: more quotation marks, commas, and colons
Essentially quickly scanning over lisp code doesn't give me any inclination about the structure at all, which I think is very important. I admit I haven't written a ton of lisp so maybe that's the problem.
(package
...
(build-system gnu-build-system)
(arguments '(#:configure-flags '("--enable-silent-rules")))
(inputs (list gawk))
Looks like a list with name/value pairs, but it's not, that's just the (package)-macro making that thing behave that way. And it's all quite arbitrary, '#:configure-flags' there is a name/value list too, but constructed completely differently. And the next line with (inputs) constructs a list with (list) instead of with a ' quote, as otherwise the list would contain the symbol 'gawk' instead of the value.Scheme is basically: "Here is the a bunch of Lego, go build yourself a programming language". Other language have syntax that forces at least a minimum of consistency.
I like Guix as a standalone package manager much much more. It has first-class support for single-file environment config, and it's in lisp! But a package manager system ultimately comes down to resources poured into maintaining and supporting packages, it's a bootstrap problem. It's clear that NixOS has substantial support. What about Guix?
I like Guix better in principle as well, but it should be clear that its principled stance on what software can be packaged means it's a nonstarter for many people.
So I think comparing the size of package collections is less interesting than checking whether your packages are included. Personally, I would have a very hard time with Nix because I need the quality control in Guix that gets me packages that have been built completely from source without depending on opaque upstream blobs (e.g. bundled jars, minified JavaScript, etc). Because of that I wouldn't be able to use Nix productively for bioinformatics, statistics, and things like pytorch in the same way as I use Guix.
Additionally, Guix's package collection growth currently looks exponential, year over year. The package collection size gap, assuming it sticks around at all, is only going to shrink (relative to the total size of either collection) and matter less and less over time.
Including me. Guix actively makes it harder to install nonfree software, and that's against my personal principles, in addition to making my life harder on a practical level.
Guix doesn't care what software you install with it. It doesn't demand that you subscribe to any philosophy. The project just chooses to only package and distribute free software in the main channel. There are projects that have dedicated themselves to extending Guix with non-free or ... weird software. Guix will never go out of its way to make using those channels harder.
Personally, I containerize the weird build tools I can't fully trust (vendor toolchains etc) and have wrapper scripts (written in bash) in PATH. The IDE is none the wiser that those are containerized.
It's possible to have multiple packages in a permanent custom profile, if that's what you mean (that's kinda the manifest stuff at the end of the article). Those can be started all in the same container. For example, yes, you can have a profile which contains java-eclipse-jdt-core, gcc-toolchain and gfortran-toolchain for your specific project. This does not change your specific project's package.
If you are asking whether java-eclipse-jdt-core, gcc-toolchain and gfortran-toolchain would be referred to in your guix.scm, I wouldn't do that. But in your profile? yes.
>Would one need to install the IDE as a dependency of a project?
Why that? The IDE, like a text editor, is a developer tool and doesn't end up with the project artifacts that you are building. So it's not any kind of dependency of the project.
For example when you build Java projects using Eclipse, your projects are actually built using gradle and then openjdk. So gradle is a native-input, openjdk is a build system input and Eclipse is NO dependency of your project's guix package.
Your developer profile, however, can contain multiple packages (in the container). That's not what's built when you build just the package using "guix build -f guix.scm", though (those builds are isolated).
Think of a profile as something like as set of packages and also environment variables that you can refer to as a whole (containerize etc) using a new fixed name.
Or think of companies where you have different hats on. Depending on the hat, you would have a profile--so the developer hat doesn't actually have the tools to delete production :)
Most other distributions have just one global profile, not even per user. In guix, you have a default profile ".guix-profile" per user, and you can make any number of extra ones (no sudo needed).
>when you have multiple projects with different dependencies open at the same time?
Hmm, I think I can see what you are getting at. I don't know whether there are IDE plugins that are guix-aware. Would be easy to do though (it would just use a custom build step as the only build step - "guix build -f guix.scm" . This automatically makes a container with your package, its build system and your package's dependencies in it and builds that (if dependency is not built yet, makes a container with that package and its dependencies in it and builds that, and so on, recursively). The IDE would then pick up the output of "guix build" which is the path to the result (somewhere in /gnu/store/...)).
The path names used inside and outside the container are the same, and the dependencies are kept around for a while, so the IDE will have a good time referring to those for headers etc when debugging or doing autocomplete.
$ mkdir -p ~/profiles
$ guix package -p ~/profiles/developer -i gcc-toolchain gfortran-toolchain emacs
$ guix shell -p ~/profiles/developer --check
(env)$ cd yourproject # which has guix.scm inside
(env)$ emacs
(have emacs do "guix build -f guix.scm" in there from time to time)
This creates a new profile "developer" (you might want that to be more granular eventually, but whatever) with the 3 packages inside and then starts a shell inside that profile. You will have access to those inside that shell (only guarded by PATH etc), but you will ALSO have access to all the tools-outside-that-shell.If you want to containerize, you can do that, too. Note that then you won't have any of the usual packages, including coreutils, available (no "ls" :) ):
(env)$ exit
$ guix shell -C -p ~/profiles/developer --check
(env)$ ls
sh: ls: command not found
(env)$ exit
$ guix package -p ~/profiles/developer -i coreutils
$ guix shell -C -p ~/profiles/developer --check
(env)$ ls
It works! (env)$ guix
sh: guix: command not found
Well, that can't be good. (env)$ exit
$ guix package -p ~/profiles/developer -i guix
$ guix shell -C -p ~/profiles/developer --check
(env)$ guix build -f guix.scm
It works!Note that the "-C" automatically also exposes the current directory that "guix shell" saw when starting up to the container.
(env)$ exit
$ guix package --export-manifest -p ~/profiles/developer
(specifications->manifest
(list "guix"
"coreutils"
"emacs"
"gfortran-toolchain"
"gcc-toolchain"))
$ guix package --export-manifest -p ~/profiles/developer > yourproject/manifest.scm
$ guix shell -C -m yourproject/manifest.scm
(env)$
Works the same as before. Now more declarative. And you can throw away ~/profiles/developer* now, it will be rebuilt each time (with caching, don't worry).For example, .NET core is nonexistent in Guix and nobody in the community seems to have any use for it. Also, there's an upstream bug report in dotnet core stating that it doesn't have functioning bootstrapping (AT ALL), and Microsoft doesn't care.
Java bootstrapping in Guix actually works pretty well, but only up to (and somewhat excluding) Maven. Everything higher than that is extremely difficult to build without cheating.
So I'd say if you use C, C++, Rust, Scheme, Haskell, R, Python, Ruby, Perl or stuff like that, Guix is awesome.
For Java with Ant, it's ok (something like 20 different Java VM and JDK packages are in guix, so you can do everything Java can do).
For Java EE, it's doable but convoluted (just install binary IntelliJ community edition from IntelliJ's website, for example). I'm using that myself, on Guix, and it's ok.
For .NET, ha ha, better be prepared to use mono from Xamarin. Realistically, .NET is not working. .NET IDEs? Nope.
>After all, the IDEs were not designed to work in Guix environment
It depends on how much they need to be designed for that. It works very well for IntelliJ, and I don't think that IntelliJ can tell at all that it's inside a guix profile.
What is true is that IDEs could make more use of the EXTRA power that guix gives (like guix build --with-source and guix build --with-patches in order to automatically patch dependencies for quick tests), and it's totally annoying that they don't.
Note that Docker is also available in Guix, both the actual daemon (not that guix uses it...) and as a guix build output target.
This is automated with direnv and an extension for direnv in your ide so this transparently happens when you open that project.
tl;dr Ide plugin to use same PATH and stuff as nix develop
So you can for example use WSL2 on Windows with a small Linux distribution and then extract the guix binaries from the website guix.gnu.org onto there, start guix-daemon in there and use guix like that. That said, I care about bootstrappable builds, so I can't recommend using a hypervisor I can't trust (Windows Hyper-V) as a base.
That's if you want the development environment.
On the other hand, for using guix packs of your software, you don't even need to install guix. Just unpack the pack as-is (or use docker).
Note: guix supports cross compilation, so you CAN just use --target=x86_64-w64-mingw32 and it will compile your program for Windows native just fine. The computer that is doing the building needs to be Linux- or Hurd-based, though.
Sometimes people come and try to port guix to cygwin or whatever but I have no experience in how far that is.
What's your use case?
x86_64-linux
aarch64-linux
i686-linux
x86_64-darwin
aarch64-darwin
Perhaps some day this will also be possible for Guix, but I don't think it fits the ideology of Guix since MacOS isn't free (not as in beer).I just wanna note here that the hesitation to invest in macOS support in the Guix development community is technical as well as ideological. macOS is a difficult platform to support for third-party package managers, and developer interest in macOS support is a difficulty within the Nix community, too. There's a lot of breakage on major macOS upgrades as well as some fundamental portability and hermeticity problems on the platform.
That said, (as an outsider) I think it would be awesome if Guix ran on macOS, just like it's ultimately a good thing for the world and for GNU that Emacs runs pretty well on macOS.
- x86_64-linux
- i686-linux
- aarch64-linux
- powerpc64le-linux
- i586-gnuIt is sad to see so many Linux only software, especially when there is no technical reason not to support *BSD.
Guix' packages include glibc in their dependency chain, so unless you can use glibc on
BSD, there is your technical reason. For example GNU Hurd is supported in addition to Linux.I'm aware Nix is closely integrated with SystemD, so availability on BSD will probably never happen (though perhaps you could use the Darwin code as a starting point?), but I'd be curious to know what in particular limits Guix from being ported.
The reason is that, it seems NixOS do not sign their packages. I've checked the messaging platforms, and while there seems to be a consensus that its not needed, I'm at present unconvinced (especially since Guix, to my knowledge, do require signing).
On its own I'd actually be OK with looking past this, but the lack of documentation on mandatory access control, secure boot, and general sandbox consideration, makes me concerned on multiple fronts. Which is a shame, because like I said, NixOS is a delight to use.
However, only Guix has signed commits in its repository (the repo contains package definitions) and a mechanism for secure updates: https://guix.gnu.org/en/blog/2020/securing-updates/
The problem goes well beyond though: as far as I know, Guix is the only project that has a Git repository that users can authenticate when they pull from it.