Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Laya the open source version of Jev(convaiinnovations.com ↗)
    81comments
  2. What Zig felt like, coming from Rust(besok.github.io ↗)
    47comments
  3. A graphical desktop for the ZX Spectrum(github.com/mindbox77 ↗)
    8comments
  4. AI-generated posters don’t have to be horrible(john.hartnup.uk ↗)
    373comments
  5. Tin: full-text search for Postgres(planetscale.com ↗)
    3comments
  6. Human brain is two separate organs, Stanford Medicine-led research finds(stanford.edu ↗)
    166comments
  7. “The Secret Life of Circuits” is here(coredump.cx ↗)
    37comments
  8. Asking Authors About Their Own Papers(medium.com/tmlrorg ↗)
    7comments
  9. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    521comments
  10. Black Holes or Black Hole Stars? Astronomers Spar over 'Little Red Dots'(quantamagazine.org ↗)
    7comments
  11. GPT-6 Astra Solves a WWI German Radio Cipher(prinzai.com ↗)
    121comments
  12. San Francisco Onion Futures Company(onionfutures.com ↗)
    94comments
  13. If math is more than proof, we need to better celebrate the rest of it(terrytao.wordpress.com ↗)
    174comments
  14. Learning Another Language May Be One of the Best Ways to Keep Your Brain Healthy(theconversation.com ↗)
    11comments
  15. Cloudflare Quick Tunnels(cloudflare.com ↗)
    299comments
  16. How to Write with an LLM(sockpuppet.org ↗)
    358comments
  17. Communication by means of modulated Johnson noise(pnas.org ↗)
    16comments
  18. You can run Git on object storage if you re-make packfiles(tigrisdata.com ↗)
    23comments
  19. Saving another 100TB of RAM(cloudflare.com ↗)
    87comments
  20. SDCC – Small Device C Compiler(sourceforge.net ↗)
    22comments
  21. Science Is Open Software(jepedersen.dk ↗)
    47comments
  22. From Stonemasons to Carpenters(thelastsoftwareengineer.substack.com ↗)
    4comments
  23. Why building a Rust LSP is hard(rust-glancer.github.io ↗)
    44comments
  24. Ray Ozzie and the Optimism of Being Early(reproof.app ↗)
    6comments
  25. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    119comments
  26. Ctenophores: Wonders of Biology(quantamagazine.org ↗)
    6comments
  27. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    115comments
  28. NASA-IBM Lunar Foundation open-Source Geospatial AI Model(usra.edu ↗)
    5comments
  29. OpenJev(openjev.com ↗)
    276comments
  30. Goroutine Leak Profiles(go.dev ↗)
    6comments

GNU Guix 1.2.0

237 pointsby 5y agoguix.gnu.org
134 comments
5y agoHN ↗

Not completely related but I decided on my latest GNU/Linux distro install that I much prefer the macOS model with slow updates for the major stuff with optional use of Homebrew and other updating mechanisms for the add-ons. One of the things that I got tired of was having to run updates on Fedora, Ubuntu, etc. So I decided to install Debian Stable with the Nix package manager as a sort of Homebrew replacement. This way I don't have to worry about my distro breaking, while I can get new stuff that is atomic and easy to remove when I want. I am curious if any Guix users do something similar.

5y agoHN ↗

I definitely do. It takes some reading the docs and perhaps asking people how to do it, but you can have some environment defining files a folder of any project and use GNU Guix to enter a reproducible environment. I cannot yet do that for all the things, where I would like to do it, because I often miss a package or get an error when trying to import it from other package repositories like PyPI and am not able to solve these without help from the mailing list. People on the mailing list are very helpful though.

Sometimes a good way to do something on the command line is missing, but the stuff that is there has a great CLI interface, in my opinion. One of my favorites is the time machine.

5y agoHN ↗

I like Gentoo for this reason. I can leave core elements and stuff I don't care about on "stable" while selectively choosing "unstable" for things I use every day. Unstable is pretty stable for the most part. The nice thing is the stable core is still rolling so no major updates.

5y agoHN ↗

Gentoo was too hard for me to install (command-line partitioning is just too risky) so I ended up using Redcore, which has a nice GUI installer, and is Gentoo-based.

5y agoHN ↗

command-line partitioning is just too risky

So partitioning a device is less risky with a GUI? That doesn't make sense.

EDIT: I should be more constructive:

I know that the command line scares some people, but that's just like computers in general scare most people, it's just something you have to get over with.

Another "scary" thing is the choice that exists between multiple available partitioning tools, I know it took me some time before I decided that the good old fdisk was my choice, but really, it probably doesn't matter, any should be OK. You probably won't actually do it directly from the command line anyway, e.g. fdisk is dialog driven instead.

Lastly, I doubt that it isn't possible to fire up Xorg from the Gentoo install media and then partition from a GUI tool, if that's what you want.

5y agoHN ↗

I personally find it easier to see the gui layout of my disk before I press play. Gparted can queue and execute a lot of changes to get to your desired state. Very intuitive for people like myself who doesn't deal with partition layouts and filesystems on a daily basis.

5y agoHN ↗

Don't get me wrong, seeing the layout is great if you don't mind the requirement for a GUI, but the fdisk UI is actually pretty good, too. It also queues and executes a lot of changes to get to your desired state, and it can show all the sizes and offsets that define the partition layout. It's not actually a command line tool, but dialog-driven (you give it commands on-line, get built-in help, etc.).

5y agoHN ↗

I did try to run startx from the Gentoo installer, but it isn't available.

Command-line partitioning isn't the problem, per se, it's the lack of manual config options. Zenwalk (Slackware) has a command-line installer, and that detected my existing partitions correctly and let me install.

5y agoHN ↗

To reiterate the point you are replying to:

Using a command-line partitioning utility like parted or fdisk is more risky to interface with, at least for the layman.

Am I using GPT tables? How many blocks for this partition again? What partition type am I marking this? Am I using a capital G to denote gigabyte? A plus sign before or after the number? What is the current state? What is the planned state?

These aren't particularly difficult questions, but they are more easily answered when using a GUI tool like GParted than they are when using fdisk or parted.

GParted is an excellent GUI. I personally haven't seen a more reliable and usable partition utility. It's my first and last recommendation, no matter what the user's background, and it will likely continue to be for a very long time.

5y agoHN ↗

Cfdisk. Much better and still terminal based.

5y agoHN ↗

Better than fdisk? Yes. Better than GParted? I don't think so.

5y agoHN ↗

You can always boot any Linux rescue system (Knoppix) and use gparted to figure out the partitioning, then continue their cli install. I do agree that partitioning by commandline is scary biz. A good TUI (think weechat, htop, tmux quality) would do great for this purpose. That is, if the machine is a pet and not cattle.

5y agoHN ↗

Repartitioning from another distro (Elementary in my case, due to WiFi and trackpad support) is what I did for most of the installs. I still wasn't fully sure how to run the CLI commands for a particular partition, rather than a full disk. In the end, Redcore just gave a better installation process for the same backend kernel.

Speaking of Knoppix, though, it worked great for USB boot, but I couldn't for the life of me manage to get Knoppix booting from an internal partition. Flashing the ISO makes 3 partitions from USB, and if I copy those to internal partitions with cp -Lr, and set the boot flags, they're still not detected. Eventually I just used Kanotix.

5y agoHN ↗

I used Gentoo exclusively for 5+ years (around 2002-2007) and after the umpteenth update which broke printing, I switched to Debian stable, and will probably use it for the rest of my life. Being able to get stuff done without having to worry about random stuff breaking was a very positive life change. Back then most Gentoo ebuild authors updated versions of all dependencies of a package, as well as the package itself, which

5y agoHN ↗

Things are so much better now. I used to use Arch Linux around that time while I was at university. During my coursework I was procrastinating and decided to upgrade my entire system. It broke. With only hours left until the deadline I chucked in one of those free Ubuntu CDs I have lying around and was back up and running within an hour.

I stayed on Ubuntu for years after that. But now I've gone back to Gentoo and it's very impressive. Everything just works. I'm sure it's partly due to my extra experience but I really don't have a problem with stuff breaking. Things are so much better now.

5y agoHN ↗

I have several machines running NixOS and one running Guix.

In Nix you have several channels that push package updates. The stable one moves very slowly, and because Hydra tests packages, it's really rare to experience broken things.

You can also mix them and e.g. install some packages from unstable, and keep others from stable.

Additionally Nix and Guix provide easy total and partial rollbacks, so you should not be afraid of breaking anything.

5y agoHN ↗

Have you preferred Nix or Guix (specifically in writing the configuration/managing the system)?

5y agoHN ↗

They are both quite different as its an internal DSL vs an external one. Just give them a try.

A major difference at the minute might be package availability. Nix has more packages but some are broken, e.g. Julia. Guix has very clean and reproducible packages, and a slightly better CLI interface.

5y agoHN ↗

Might as well try out NixOS.

I've been using it on all my personal devices for ~6 months and also for some bare metal sever deployments.

A (mostly) immutable system configured with a single config file is an absolute killer feature.

The ability to roll back to a previous config in the bootloader or the terminal is brilliant.

And home-manager [1] provides the same experience for your user environment.

I also looked into Guix, but the community and package repository seem much smaller.

They also don't accept proprietary software in the official package repo. Which is a respectable ideological choice, but really reduces usability a lot compared to nixpkgs.

[1] https://github.com/nix-community/home-manager

5y agoHN ↗

I’m on NixOS and had the same feeling when first debated which to use.

If I was running some security sensitive app or scientific computing I would probably choose guix and they tend to be pretty rigid about reproducible building from source and signing changes to to the OS. But my day to day OS I use NixOS as I get tons of packages and basically all the same features with the trade-off of expecting some weird behavior on edge-cases and reproducibility (which I have yet to run into but know I will eventually)

5y agoHN ↗

I tried to install NIX, but the graphical installer wouldn't boot. I'd have the option to choose it in GRUB, but it went to a command-line.

Then when I tried the text-based install, it couldn't see my NVME disk.

5y agoHN ↗

Weird, i stumbled through NixOS, a dual boot grub setup, and backed by NVME with no issues and very little Linux information to start with.

Currently on NixOS btw, been a great experience from it so far.

5y agoHN ↗

My SSD is an Intel 660P, if that helps debugging in any way. Installing using nixos-gnome-20.09.1889.58f9c4c7d3a-x86_64-linux.iso.

5y agoHN ↗

I also have an Intel 660P, works fine with NixOS. It shows up as /dev/nvme0n1 .

5y agoHN ↗

I tried to install NIX, but the graphical installer wouldn't boot.

I've had the same issue. Nix uses KDE Plasma by default, which uses a compositor that struggles with some video drivers.

Fortunately, installing from command line is practically the same, especially if you do your partitioning beforehand.

Then when I tried the text-based install, it couldn't see my NVME disk.

That's a more unique problem. I'm not sure what to do about it either. Did /dev/nvme0n1 just never populate? My best guess is that you booted emulated BIOS instead of UEFI.

5y agoHN ↗

Like the other replier, I also found NixOS very difficult to install and my hardware wasn't supported as well as Debian was.

5y agoHN ↗

I gave NixOS a serious try... the reason I gave it up was that pretty much all build systems for my own projects were broken and it was a pain to "nixify" them.

5y agoHN ↗

I know the "cool thing" these days is homebrew, but there's also MacPorts [1] which I would say it and aligns better with the "use a stable base + compile the latest things" approach.

MacPorts does not use the base system to compile the latest things on top. Instead, it creates a "parallel system" where everything is installed from MacPorts (and hence you all dependencies are continuously updated) for the "latest stuff" you install through MacPorts, while not touching the system stuff at all.

[1] https://www.macports.org/

5y agoHN ↗

I haven't tried it so I don't have an informed opinion.

All I can say in is that MacPorts has served me well for over 10 years at this point, with remarkably few issues (even after updating to newer MacOS releases).

A couple years ago I wanted to install restic, which had homebrew instructions but not a MacPorts package. I don't remember the details, but the installation through Homebrew failed. In the end, I got rid of Homebrew entirely and created a MacPorts package, which took me around 2 hours with no previous knowledge on MacPorts packaging. It was accepted upstream too :)

Since then it just hasn't seemed necessary to try out other package managers. MacPorts fills that need for me and I prefer to spend my time elsewhere.

5y agoHN ↗

When a Guix system upgrade breaks something important, you can simply boot up the previous "generation" of the system and get back to work until the blocker bug you encountered has been fixed, at which point you can attempt the upgrade again.

5y agoHN ↗

Where are the pain points using guix on void? Asking because I may be switching my desktop over to using guix on a foreign distro

5y agoHN ↗

Guix works exactly the same no matter which distro you run it on.

5y agoHN ↗

I run Guix on Void.

Guix doesn't care what distro you run it atop of.

5y agoHN ↗

While reading this discussion, I was thinking exactly the same thing. Normally I use /testing/ distribution of Debian GNU/Linux. But with Guix, I can just install bare-minimum Debian /stable/ and work with Guix for the rest.

This way we'll also get security updates. Debian is committed to providing security updates for the /stable/ distribution. Not sure about /testing/ and /sid/.

5y agoHN ↗

Yep, Debian/Guix is my setup for my main laptop.

I actually ended up using testing rather than stable for ... reasons but I think if I did it again, I’d stick with stable. Of course, I always think that.

5y agoHN ↗

I was complaining how weird the Nix language is, until I saw Scheme.

5y agoHN ↗

Scheme is a pretty old lisp dialect https://en.wikipedia.org/wiki/Scheme_%28programming_language...

I give Guix folks a lot of credit for sticking with a pure language but after using Nix expressions for a bit favor how pragmatic it is for day to day stuff.

Though I should note: I trust Guix more than nix. I use nix for convenience but really admire what Guix has done in terms of taking the concept of a functional package manager to be as pure as they can. The security stuff they’ve incorporated is very admirable and a compelling reason for me to switch over https://guix.gnu.org/blog/2020/securing-updates/

5y agoHN ↗

Not OP, but it's a declarative configuration system, so an existing declarative language like Prolog would seem to fit naturally. Declare the relations between packages, the constraints that must be satisfied, and let the compiler perform unification to get the resulting configuration.

5y agoHN ↗

Scheme/lisp might be weird for some. But Guix packages are written in a highly declarative style. Very little control flow. It looks kind-of like JSON.

5y agoHN ↗

Relatedly, what is going on with that header image? I kind of love it, but it nevertheless leaves me confused.

5y agoHN ↗

Guix makes me feel good. Even in case there is package version conflict because I tried various version, I can stay calm and feel safe. Just run `guix upgrade` on the affected packages solves the problem well. An a rollback is also not far away if everything fails. Any package conflict on my old grown Debian system has made me sweat with fear after years of piled up apt packages intermixed with /usr/local installations.

5y agoHN ↗

Neat! Love seeing more takes on this (nix-like builds)

5y agoHN ↗

I tried installing GUIX on my 2013 MacBook Air 11" on Sunday night.

The installer insists on erasing the entire disk, not sharing with other partitions.

I removed the SSD for safety, and plugged in a second USB stick.

The installer took from 21:20 to 7:30 am the next day. It needed to be connected to wired Thunderbolt Ethernet, which in my case means in the laundry.

Downloading packages took a long time (about 2 hours). "grafting" took longer. Finally it failed to set up the bootloader. No big deal, try GRUB or rEFIt, right? But they didn't detect it.

There is an "EFI Boot" option in the startup menu (holding option). That just boots to a black screen.

I'm sorry, but issues like this mean that I think GUIX is not desktop-ready for bare metal. It'll be relegated to a virtual machine (along with OpenIndiana, PureOS, Haiku, Hello, etc).

5y agoHN ↗

You are aware that you are trying GUIX out on hardware which has been tightly locked away from being interoperable with anything besides MacOS, right?

5y agoHN ↗

Are you aware that Apple hardware pre-2015 was much more open than it is today? I agree with your sentiment for modern Macs, and that's why I'm trying to find a suitable OS for switching.

When there's a limited scope of what drivers are required, it should be easier, not harder, to support certain hardware. Being unable to read NVME drives (which have been around since 2011) is no longer acceptable for an OS in 2020.

5y agoHN ↗

AFAIK Guix stays very true to the GNU values of ONLY shipping free software, including drivers. A couple years back I had a similar issue where I couldn't get my WiFi card to work because I'd have to recompile the kernel while including nonfree libraries... which is pretty hard to do if you know nothing about Guix!

Maybe I'll try it again in a while. Not sure if it's available for raspberry pi, but it would be great to try it there and eventually switch to it on my laptop (once JJ change WiFi card!)

5y agoHN ↗

I used to have a 2011 macbook pro. I couldn't boot USB media at all. It's not a new problem. After my optical drive died, I had to resort to creating my own installation media on a hard disk partition..

Guix rejects non-free software in their repos, so I would be unsurprised to hear that no contributors use Apple hardware.

I agree that what you are trying to accomplish should be doable and even non-trivial. This is definitely a disadvantage of having a more automated installation procedure.

5y agoHN ↗

You can do manual partitioning in the installer.

The 1.1.0 release had a problem with certain EFI configurations, but I think they are fixed with 1.2.0. If not, please file a bug report!

5y agoHN ↗

I tried both.

Choosing NIX - Installer from GRUB just boots live, not actually an installation process.

I tried copying the USB stick to a partition using cp -Lr. Still not booting. I tried manually specifying that partition using GRUB. The errors were:

Timed out waiting for device /dev/root, trying to mount anyway.

mounting /dev/root on /iso...

mount: mounting /dev/root on /mnt-root/iso failed: No such file or directory

At that point I gave up.

5y agoHN ↗

I love Guix in theory, but I have a lot of issues with performance. Literally orders of magnitude slower other package managers. Downloading is slow, even if the total download size is small. Recently, it took two hours to upgrade Julia because, I guess, it wasn't available on the substitute server.

5y agoHN ↗

When you think of Guix as a source distribution first and a binary distribution second this makes sense. The build farm is just another user that builds everything from source. If it didn't catch up with the builds because someone just changed a package definition then you might be requesting a binary that hasn't yet been built.

Slow download appears to depend a lot on location to an extent that we suspect peering problems. The main build farm's head node is connected to the internet from a well-connected research campus with dual 10G. Multiple tests have concluded that the configuration from server-side software, to network hardware of the server, down to networking in the data centre is sane.

Maybe we'll have to bite the bullet and (again) use a CDN to better serve users that inexplicably experience slow connections.

5y agoHN ↗

What about integrating (and encouraging users to opt into) peer-to-peer distribution? If I understand correctly, this would work for Guix and Nix.

I'm not using Guix, but if I was I would be happy to do this. I have no data cap on my home internet, and my PC is usually on.

5y agoHN ↗

There was early work on using IPFS as a substitute distribution mechanism, but the API changed and nobody has picked up the existing work yet. But I agree that this would be a great feature and I hope someone will feel motivated to pick up and assemble the pieces.

5y agoHN ↗

The implementation requires that you have at least one authorized substitute server advertising the same hash.

In simplified terms, if ci.guix.gnu.org advertises a substitute for /gnu/store/abc123-foo, with the checksum "xyz789" (and the cryptographic signature of that advertisement checks out), your daemon can safely download that file over P2P.

5y agoHN ↗

Ah, I think I'm misunderstanding the intent here. Clearly P2P distribution of checksummed binaries can be safe, I was just wondering if there were a solution to the build farm being behind. It seems like you can't really trust the first build of any artifact unless it comes from a central source.

5y agoHN ↗

There have been discussions of an "N of P" distribution, i.e. if 80% of available peers (or substitute servers) advertise the same build result, then treat it as safe.

I expect that both will be implemented, and the choice left up to the user.

5y agoHN ↗

Unless I'm massively underestimating the number of Guix users, that seems quite easy to exploit.

5y agoHN ↗

With regards to downloading speeds, the issue seems to be downloading many packaging as opposed to large packages. Each package incurs some noticeable overhead, which is painful when upgrades consist of dozens or hundreds of upgraded packages.

5y agoHN ↗

I firmly believe that Nix (and/or Guix) are the future. I am going to use Nix as the keyword below, but Guix and Nix are so very similar that everything is also true for Guix.

Snap, Flatpak, Docker, AppImage, etc are all very complex solutions that are actually quite painful to interact with. Nix on the other hand solves the problem extremely well. You can have different complex applications running side by side with very different dependencies trees and they will not cross paths.

Every time I see a package being distributed as a Snap, I wonder why. These containered solutions are very complex, trying very hard to emulate FHS with mount namespaces, binding mounting tons of sockets around, and almost always end up mounting all of /home in the container. The don't provide much security, and quite difficult to deal with, and require a daemon.

Nix on the other hand has zero containerization requirements. It simply works by ensuring the programs are looking in the right place for the libraries they need. It would be great if more vendors just shipped a Nix derivation (or store path) that was their application stack. It would end version incompatibilities for ever, in a way that isn't a burden for the user.

Nix + bubblewrap add all the benefits of snap and flatpak as well. But again, there is no benefit to bubblewrap is if you are just going to blanket allow read-write everywhere anyway. At least with raw bubblewrap you can make these policies actually protect something.

Similarly, Nix is easily installed on any existing system. So you can use nix packages on Debian, Ubuntu, Centos, Fedora, DSL, or any other linux distribution because it runs entirely out of /nix. I use nix packages on Archlinux at home, and Debian systems as work.

Cross distro development works 100% of the time because Nix doesn't use anything from the distro.

Nix (and Guix) are really what the Linux community should be moving towards IMHO. I personally prefer Nix's syntax, but the underlying technologies are so similar I consider them the same. Guix started as a fork of Nix, and one day I hope they decide to end up becoming compatible with each other again.

5y agoHN ↗

Guix started as a fork of Nix

This is repeated often but it is an unfortunate misunderstanding. One self-contained component of Nix was used unaltered in Guix: the nix-daemon. Everything else but the daemon (and that's a lot) is a completely independent implementation of the same principles that were first demonstrated in Nix: functional package management.

Why reuse the daemon? Because it could be done. The daemon takes very low level build instructions ("derivations") and arranges for them to be executed in an isolated environment. In Guix derivations are generated through compilation of higher level concepts that as such have no correspondence in Nix.

The common ground is the format of the derivation, which has only been modified occasionally to better suit our differing needs.

5y agoHN ↗

My point was more than guix and nix could both write to the same store using a single daemon compatible with both in the future. Ensuring some cooperation between the two going forward.

That currently isn't possible, but would be nice.

I imagine it could only work for packages, not for system configuration. But that still would be a huge win.

5y agoHN ↗

System configuration is also just another store item, really. The current development, however, is to move away from the old nix-daemon and to (slowly) finish its replacement that reuses all of the other existing Guix features for process isolation and building.

This is desirable as there are minor annoying differences between the build environment spawned by the C++ daemon and the environment one would get using "guix environment --container". Unifying this by simply using Guile on both sides of the divide (build side vs host side) would allow for more code reuse within Guix and unlock a few features.

It's not a high priority because the modified nix-daemon works fine for now, but a CS student is moving forward with the Guile daemon as a university project now.

So the dream of sharing the same daemon may not be realistic. I think that this is not a big deal, because the daemon really should serve the project and as the needs of the two projects diverge so do their respective daemons.

5y agoHN ↗

System configuration is just another store item, but symlinked, copied, or referenced by other places outside the store as well. Such as systemd services.

You're likely right though that compatibility between the two projects will continue diverge. My true dream was that vendors wouldn't have to build for Snap, Flatpak, Guix, and Nix. They could just use either Guix or Nix and have something usable by either user base. In the end the outputs are just writing stuff to the store.

But the fact that the store paths are already different would make it a huge migration for that path to change in the future, and unlikely to ever happen. Still, I can dream.

5y agoHN ↗

One thing that flatpak has over nix is the set of common bases. If I was going to distribute something shifted from nix, I'd essentially need to move every single dependency (which needs to be compiled/configured right). It's not a huge problem for a cli tool in golang, but something that requires qt, GL, input method support, etc.? I'm glad there's a flatpak base for those that not only "just works", and it's going to be maintained/distributed even of the app isn't.

5y agoHN ↗

I'm not sure I understand this argument. The main difference when compiling is that you use --prefix=$output instead of --prefix=/usr (which is nicely abstracted away by build systems).

You can 'guix pack -RR ibus qutebrowser', copy the resulting binaries to any GNU/Linux system, and still expect them to work.

5y agoHN ↗

Yes you can, but you have to compile and distribute them all. And again distribute every single update for them. You end up with "nothing changed in my app, but there's the whole package again with a fixed deep dependency of foo". (Or more likely, no update)

5y agoHN ↗

Right. Referring to exact versions of dependencies is a feature of the functional package management model. How else can you guarantee that the program will behave exactly the same every time you run it?

Guix (unlike Nix) supports "grafts", so you can change something deep in the graph without having to compile every dependent package again. But grafts also produce different store items of course, so no big difference for "guix pack".

5y agoHN ↗

Oh, cool. I don't see it being used anywhere though, apart from being available as a system activation function?

In Guix grafts are used rather extensively, mainly for security updates, but also command-line transformations such as "--with-debug-info".

5y agoHN ↗

And it depends on your use case - whether you want to guarantee exactly the same behaviour and ship all the dependency updates yourself; or do you want to have less maintenance burden and trust the base layer to not change behaviour.

In a tightly controlled environment inside a company where the update mechanisms are preconfigured / enforced, I'd go with nix model. When distributing an app to people on the internet, I'd choose flatpak model.

5y agoHN ↗

But you simply don’t have to worry about it. You test it on the next LTS release of nixpkgs and that’s it. Your user may download a bit more data, but I found that nix is lightyears faster then fedora’s build tool, and on par with arch, while not polluting the whole filesystem with random files. I don’t see where would you need more maintainance.

5y agoHN ↗

Nixpkgs already packages all of the things you've mentioned (qt, GL, input method support). So to package your own software with Nix, all you have to do is specify them as dependencies. There's no need to "move every single dependency" at all.

5y agoHN ↗

"packages all of the things" == "move every single dependency". We're talking about the same thing.

5y agoHN ↗

Nix and Guix have too steep of a learning curve. Maybe someday I'll be willing to invest the time to understand what's going on, but the CLI and docs just aren't good enough to go from "I know nothing" to "ah, I can install the latest <firefox,inkscape,chromium,etc.>". It really isn't clear to me how to switch a running system's package manager to either or even if either is fit to be the system's main package manager.

I watched a video of a seasoned linux user trying to install nix and abandoning the procedure because of the lack of docs. I even downloaded a virtualbox image of NixOS and tried to update everything to the latest version: 30 minutes later only firefox was installed but it wasn't in PATH thus couldn't be executed. Never found out how to install the KDE desktop.

Guix was another beast that I tried installing as a non-root user (insisted on using `curl | bash`, which I loathe). It was never up to date and I couldn't find the package I wanted to install (so fancy new chromium wrapper.. next-browser or something).

Maybe now things are better, but back then (1-2 years ago), neither were anywhere close to modern GUI distros. Until they make it easy to use, it's going to stay niche.

5y agoHN ↗

Guix has never insisted on 'curl | bash'. At first there were no instructions on how to use the shell installer script (perhaps you translated to 'curl | bash'?), but now the manual explicitly recommends to wget and chmod it:

https://guix.gnu.org/manual/devel/en/guix.html#Binary-Instal...

I think you'll find that things are much more up to date nowadays. You still need root access for the guix-daemon though.

5y agoHN ↗

I realize that you just cited two particular issues as examples for a deeper problem. But still: The command `nix-shell -p firefox` spawns a subshell in which Firefox is in the PATH. (In case Firefox has not been downloaded before, it will by this command.) Others shells are unaffected by this command, and in fact, it is possible to have different versions of Firefox available in other subshells. This feature might be especially useful to web developers interested in gauging compatibility of their sites with different versions of browsers.

To enable KDE, you put this into your configuration.nix:

    services.xserver.desktopManager.plasma5.enable = true;

Perhaps you are also interested in the following cheatsheet: https://nixos.wiki/wiki/Cheatsheet

I've been using NixOS since 2017 and don't ever want to look back. I agree that NixOS is not anywhere close to modern GUI distros, but do like the documentation, and the friendliness and speed of the community.

5y agoHN ↗

I found the documentation to be plentiful compared to other projects, though it's not as comprehensive as the Arch Wiki. The docs definitely mention how to install KDE [1] and firefox [2].

To learn more about Nix, I'd recommend grepping the nixpkgs [3] repository once you grasp the basics of the Nix language (Nix Pills [4] would be a good start for that). Since everything in the Nix official repository belongs in nixpkgs, it's easy to search for the information I want. I just wish CentOS and Debian had a way of searching across the entire codebase this easily when I couldn't figure out something from the docs.

[1]: https://nixos.org/manual/nixos/stable/#sec-x11 [2]: https://nixos.org/manual/nix/stable/#idm140737322634320 [3]: https://github.com/NixOS/nixpkgs [4]: https://nixos.org/guides/nix-pills/

5y agoHN ↗

I found reading code from Nixpkgs to be very valuable as well, and can't recommend it enough. I managed to get by using NixOS without writing my own derivations for several months until I inevitably ran into a need to package something new. Even then, Nix Pills isn't a super useful reference, it's sort of like learning Git by understanding blobs, too focused on details.

Another pain point is looking for documentation of Nix library functions, I've solved this by using Manix[0]

[0] https://github.com/mlvzk/manix

5y agoHN ↗

I filed a PR in the nix pills repo like eight months ago that never got touched; they're effectively abandoned and contain hard errors. One more snare trap in the mine field that is nix documentation.

To anyone that wanders by this, if you value your time at all, don't bother with nix unless you have someone you can corner and directly get answers from.

5y agoHN ↗

they're effectively abandoned and contain hard errors

Provably false. The last commit was Oct 9, not "eight months ago," and numerous PRs were merged since then:

https://github.com/NixOS/nix-pills/commits/master

https://github.com/NixOS/nix-pills/pulls?q=is%3Apr+is%3Aclos...

don't bother with nix unless you have someone you can corner and directly get answers from.

Just because your single PR slipped through the maintainers attention? Wow, you must have to avoid a lot of high profile open source projects.

Furthermore, the official page very clearly states how you could reach the community for help, although I highly recommend you to lower your tone before doing so:

https://nixos.org/community.html

5y agoHN ↗

I find nix pills hard to digest since they use the repl, and for a newbie it's hard to see how they apply to real-world packing of something like a python application.

This video helped me a lot though, but unfortunately there are a few minutes of broken audio in the middle https://youtu.be/2mG0zM_wtYs

5y agoHN ↗

I just wish CentOS and Debian had a way of searching across the entire codebase this easily when I couldn't figure out something from the docs.

You can use https://sources.debian.org/ website to search in the Debian packages and their source code.

5y agoHN ↗

I found the Guix documentation to be excellent albeit somewhat lacking in examples.

The manual also includes a Getting Started section, so you don't need to read all 500+ pages to figure out how to use it.

5y agoHN ↗

Snap, Flatpak, Docker, AppImage, etc are all very complex solutions that are actually quite painful to interact with.

Uh... what? You're comparing these things against Guix and Nix, which require you to learn a new language to use. Not to mention that AppImage, at least, is only complex because it kinda has to be in order to be portable, single-file, directly-executable application. Which is to say, it is only complex in its implementation so that it can be much less painful to interact with [0].

Nix on the other hand solves the problem extremely well. You can have different complex applications running side by side with very different dependencies trees and they will not cross paths.

Which AppImage can do without you having to learn a new language, and as a bonus will even let you store those applications on entirely different media without recompilation or anything.

Similarly, Nix is easily installed on any existing system.

AppImages work on most Linux systems, which is about as well as anyone can do with something that requires no pre-installed runtime.

[0] and it actually isn't that complex really.

5y agoHN ↗

Guix and Nix [...] require you to learn a new language

Not true.

`guix install foo`, done.

Oh, you want to define an operating system declaratively in a file? Yeah, learn the DSL that was designed to let you do just that.

5y agoHN ↗

So the thing that is the primary value proposition of the system, yeah?

5y agoHN ↗

I think the package managers themselves, with unprivileged operation, immutable profiles, atomic upgrades and rollbacks, "guix pack", etc are the main value propositions.

The OS thing is mostly a side effect.

5y agoHN ↗

Maybe I'm misunderstanding, but isn't part of the point that the packages themselves are declarative and you're not beholden to some maintainer to get stuff? Wouldn't that mean writing your own... whatever it is your write to get software installed?

5y agoHN ↗

To install stuff with Guix you simply type "guix install foo".

From an end-user perspective, the main difference from other package managers is that you don't need root privileges (and that each user have their own "collections" of packages).

5y agoHN ↗

Both. You get to use packages others have written the same way as you do on arch. And you can also decleratively specify your build environkent, or override some attributes like apply a custom patch in a package someone else wrote. But you are just as not required to learn nix, as you don’t need to know how to write a .deb package to use ubuntu

5y agoHN ↗

Not sure about guix but the unprivileged part isn’t true of nix as you do need root to install initially.

5y agoHN ↗

It is only required because /nix is hardcoded (but only to make using binary caches possible). Later on, writing to this store is done by a nix user, and install can be issued by a normal user.

5y agoHN ↗

The problem with nix is that it defeats the purpose of shared libraries. Normally, when you upgrade a shared library, all consumers of it get fixed for free.

With nix every package is siloed into its own separate dependency graph and so you can have many versions of a shared library coexisting on the system but each version may be used only by one consumer. That means upgrading one will not affect all the others.

So then the only way to get consumers of a shared library to upgrade is to upgrade the consumers as well. Well then why not switch to static linking and be done with it? It would be much simpler that way.

5y agoHN ↗

IIUC, it’s more nuanced than that. The shared library would be specified as a dependency to the packages that rely on it. Pushing a fix to the library would trigger a rebuild of all the downstream packages during the next upgrade. This also means updates to a popular dependency will cause long upgrades.

5y agoHN ↗

From a security point of view, the Debian for example, seems to be much more reliable. It does not leave you at the mercy of libraries with security holes.

Automatically translated.

5y agoHN ↗

This is not actually a problem in practice. I had this misconception too before I started using it, though. I'll explain for Nix, since I've used it, but I assume Guix works similarly:

Packages as defined in nixpkgs don't depend on specific versions of shared libraries. They depend on the library by name, just as they do in any other OS. So a single update in nixpkgs addresses all packages on the system "for free", including ones defined outside of nixpkgs, because they're almost certainly going to depend on nixpkgs for those libraries (I mean, they could duplicate the definitions, but why would they?).

Built packages depend on specific versions. So you just have to be sure to update all your built packages. How does that happen? Well, packages are installed because they're requested by name somewhere, either NixOS system packages, or from home-manager, or from a dev environment. Those names point to packages in nixpkgs. So when you update your nixpkgs version (using nix-channel or flake update or however you're doing it), and then rebuild NixOS or update home-manager, you get updated versions of everything.

If you're using a nix-based dev environment with pinned nixpkgs (with niv or a flake or whatever), you'll have to update that pin as well, for each project. I suppose you could claim that this makes it easy to use old dependencies. Perhaps, but the entire point of pinning the nixpkgs version is to make everything 100% reproducible, bugs and all, all the way down your dependency stack. So you have to make a deliberate choice between trade-offs there, which seems fair.

As far as static linking, nix is essentially static linking, except that you still get the benefits of shared disk space and shared memory for .so files. "True" static linking might be simpler if your dependencies happen to be .so files that also have .a files, but many things aren't, e.g. dependencies among python modules, depending on other binaries to exec, data files, etc. Nix lets you "statically link" all of those too.

5y agoHN ↗

The unholy basis of all modern Linux systems named glibc does not like being statically linked. It would break slightly and sometimes seriously if you do so.

5y agoHN ↗

nix/guix = academia and like conceptualism

others = industry and leverage existing subsystems

that's why

5y agoHN ↗

I don't know what you think is needed for nix/guix that has not existed the past 20 years.

All the other technologies I mentioned require fairly recent kernels to work, namely for all the namespace shenanigans they employ. Nix can run on perfectly fine on at least Linux 3.2 (stock wheezy), so far as I tested.

5y agoHN ↗

I never implied nix needed anything quite the opposite, it was somehow from-scratch thinking, on the other systems were more inspired by new linux features to solve a slightly similar issue.

5y agoHN ↗

I think this is about right.

Nix feels pretty close to "right thing to do", but if the other solutions are more successful, it's a case of "worse is better".

I think the important part is usability compared to what's already there. It's much easier to write a Dockerfile than to write something with Nix. You can get much stronger benefits from Nix than from a Dockerfile.. but, most of which you don't really need all the time.

My impression is the other solutions are quick-ish hacks to solve problems that come from (and building upon) the complexities of systems built using quick-ish hacks. Nix feels like a more elegant solution, but it's also different enough that it's got a steep learning curve for anything harder than "install foo".

5y agoHN ↗

For the use case of "I need a Docker image with some programs", this command seems pretty neat. Nixery is a similar with Nix, where an image can be constructed ad-hoc by specifying the dependencies of an image's path.

That's cool. And I can imagine cases where it's useful.

Stuff like Nixery isn't itself enough to claim "nix is better than Docker", though. -- The questions I'd want to think about are "what happens when I run into a problem? how hard is it to fix this?". I feel like Nix does solve some problems that I've had with Dockerfiles. But there are also problems I've run into with Nix that I wouldn't've had with Nix.

I like nix well enough. But I've also used it enough that I'm not surprised if people have difficulties with it, and are more comfortable with other solutions.

5y agoHN ↗

I don't understand some details about Nix when people talk about it. Forgive me for being ignorant.

* Do packages need to be 'ported' to Nix or its build / install system? If so, how much effort will it take and on what factors the effort required to port may vary substantially? (eg: Programming Language).

* How is disk space usage? Is there any kind of deduplication?

* How are security updates to shared libraries handled?

* Transactional upgrades look great. But how is the user experience around Transactional upgrades of running GUI applications?

* Other performance characteristics - bandwidth (delta upgrades possible?), startup time (I hope this will be good)..

5y agoHN ↗

Note: these points concern Nix, the situation may be different on Guix

* Do packages need to be 'ported' to Nix or its build / install system? If so, how much effort will it take and on what factors the effort required to port may vary substantially? (eg: Programming Language).

Yes. To make Nix really work it has to be pervasive and this sometimes means porting packages again, however there's a lot of automation around this, see[0] for ones that leverage existing build systems in other languages. Autoconf and cmake packages are already accounted for by the default builder, and usually only the dependencies have to be specified.

* How is disk space usage? Is there any kind of deduplication?

The Nix store can be intensive on memory, as once a dependency such as glibc is updated, all the reverse dependencies (i.e. the set X such that X depends on glibc directly or transitively) have to be rebuilt as well. There is an option to optimise the store, but I don't know how much it helps in practice, see[1]. Garbage collection can be invoked manually or automatically to free up unused store entries.

* Other performance characteristics - bandwidth (delta upgrades possible?), startup time (I hope this will be good)..

By startup time you might be referring to NixOS. It's very good on my Late 2013 13-inch MacBook Pro, around 20 seconds to go from cold boot to login screen.

[0] https://github.com/svanderburg/node2nix https://github.com/NixOS/cabal2nix https://github.com/cargo2nix/cargo2nix https://github.com/nix-community/poetry2nix https://github.com/kamilchm/go2nix https://github.com/nix-community/pip2nix

[1] https://nixos.wiki/wiki/Storage_optimization

5y agoHN ↗

By startup time you might be referring to NixOS

I was referring to application startup which is an issue for snap & flatpak. I'd like to know how it (Nix + sandboxing solution like bubblewrap) compares to flatpak.

5y agoHN ↗

Nix doesn’t sandbox applications, it is basically only patches the ELF header so that it links to nix store entries instead of /usr/lib when it comes to shared libs.

So While I don’t have benchmarks, it is basically in the same ballpark as Arch programs.

5y agoHN ↗

Yes they need to be ported, in the optimal case it's just specifing the build dependencies and the build command.

It's deprecation addressed so you only store any given dependency & version once, but if you need multiple versions you store each.

It's easy for the storage size to balloon, but also easy to garage collect away stuff you aren't using without worrying about it

You update the library and every thing it depends on

You need to restart the gui application after the upgrade

The download size can be big, I haven't found it much more inconvenient than other distros

Start up time is unremarkable

5y agoHN ↗

Nix also defaults new build commands to the equivalent of `./configure && make && make install` so it works out of the box with a lot of packages, as long as you declare the build inputs that it may need.

As for disk size, beyond garbage collection, you can also ask Nix to sweep its store and hardlink identical files together in order to save space if you suspect significant file duplication (and if your FS doesn't already deduplicate blocks).

5y agoHN ↗

Or:

    guix install ungoogled-chromium

This CLI difference is in part due to the underlying design, which is not just about syntax (parens vs. braces) but more about abstractions and composition.

For example, the Nix language doesn't have the ability to define new data types, and it doesn't have a "package" or an "operating system" data type. That means that all the entries in Nixpkgs look alike, which in turn prevents building a "package-aware" or "OS-aware" user interface.

The Guix CLI "knows" about packages and versions, and package transformation options are an example of how the CLI can take advantage of that abstraction.

Likewise, the "guix system" command knows about services, which gives it convenient introspection capabilities such as "guix system extension-graph" and "guix system shepherd-graph".

It really isn't about parentheses vs. braces. :-)

5y agoHN ↗

This is what annoys me about Nix the most - the missing abstraction of those, resulting in an often cumbersome UX and a very steep learning curve.

Guix on the other hand provides those, but is far from what nixpkgs offers in terms of number and actuality of pkgs.

5y agoHN ↗

I think it's somewhat unfair to use number of packages vs Nix as an argument against Guix.

Nixpkgs has the biggest package repository of all the distributions, and a much larger community.

If you compare Guix against Arch for example, Guix comes out more favorably (15k packages) vs Arch's 12k.

Guix packages tend to be very well integrated too, usually running upstream test suites, leading to fewer run-time problems. I think only Debian and Fedora matches Guix on this practice.

5y agoHN ↗

Nixpkgs also has a lot of generated packages that cannot actually be built successfully, such as a large number of R packages.

5y agoHN ↗

Guix and NixOS are a generation ahead of other distributions. It's great to see Guix's focus on trust and reproducibility.

If they can grow enough to be able to support LTS, they'll be a compelling choice for enterprise too.

5y agoHN ↗

Armchair package user litmus test:

1. Is there a LTS Firefox package in Guix?

2. Is there a LTS Chromium package in Guix?

3. Is there an escape hatch if I'd rather just download an Electron binary for my package dependency rather than properly package Electron?

5y agoHN ↗

1. Is there a LTS Firefox package in Guix?

Yes, it's called IceCat and is a rebranded Firefox with privacy enhancements:

https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages...

2. Is there a LTS Chromium package in Guix?

There is no LTS distribution of Chromium anywhere. But the latest version is available, sans Google integration:

https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages...

(you can also install Chromium extensions with Guix)

3. Is there an escape hatch if I'd rather just download an Electron binary for my package dependency rather than properly package Electron?

Kind of. You can define an environment with the relevant dependencies on LD_LIBRARY_PATH (or use "patchelf"). But expect to experiment a bit to make it work.

5y agoHN ↗

As a user of both Nix and Guix, Guix really needs to do a thousand papercuts campaign because there's so much low-hanging fruit here.

The Nix shell script installer is a one-time that you can rerun without it reinstalling Nix (it will just skip if it detects an already existent Nix). Guix reinstalls (and take forever doing it). The Nix installer is much faster. You also need to make sure you import keys when installing Guix because security.

Doing any package related thing will tell you about a failure to install locale. This is straight out of the box Guix if you've installed it on, say, Ubuntu. This is not a good out of the box experience. It blows. If you Google this error you are told to install glibc-utf 8-locales but on my Ubuntu base system this doesn't actually solve the error.

If you the user can clamber over these two landmines well it's an awesome Emacs package repository. This is actually where Guix wins over its cousin and as an ardent Emacs user its fantastic to have all the most esoteric packages and weird builds of Emacs like emacs-pgtk-native-comp I source from a Guix user channel and install declaratively from a manifest.scm file.

Guix should lean into this one major strength and put out an Emacs-centered heavily opinionated installer image that uses EXWM for its window manager.

5y agoHN ↗

The Nix shell script installer is a one-time that you can rerun without it reinstalling Nix (it will just skip if it detects an already existent Nix). Guix reinstalls (and take forever doing it).

Wait, what? The Guix installer script also stops if it detects an existing installation, and has done so since the initial commit:

https://git.savannah.gnu.org/cgit/guix.git/tree/etc/guix-ins...

You also need to make sure you import keys when installing Guix because security.

If you are complaining that the installer verifies the GPG signature of a file it downloaded from the internet, I don't know what to say. :-)

Doing any package related thing will tell you about a failure to install locale.

This can happen when your installed locales are from a different glibc than what the guix-daemon was built with. Upgrading and restarting the daemon will solve it.

That said, I think the daemon recently got smarter about it.

Guix should lean into this one major strength and put out an Emacs-centered heavily opinionated installer image that uses EXWM for its window manager.

The system installer disk image does give you an option to create an EXWM system (as well as GNOME, Xfce, etc).

5y agoHN ↗

Wait, what? The Guix installer script also stops if it detects an existing installation, and has done so since the initial commit:

You're right about this, apologies. What I intended to convey was that Guix hard bails on an install so can't be scripted as part of a "dotfiles up" on a new system. Nix gracefully bails and can therefore be scripted.

This can happen when your installed locales are from a different glibc than what the guix-daemon was built with. Upgrading and restarting the daemon will solve it.

This is from 5 minutes ago. I have both glibc-locales and glibc-utf8-locales installed:

/gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)

If you are complaining that the installer verifies the GPG signature of a file it downloaded from the internet, I don't know what to say. :-)

Speaking strictly from the perspective of a desktop end-user, this should probably be rolled into the one-liner.

And, as I'm testing, I also notice that even for operations which require no changes, a guix pull takes 5 or more minutes over the equivalent nix operation. Why am I building guix-system for 5 minutes with nothing to be done?

I urge you to take all of this as friendly advice from someone who fits into the market category of Guix's next million users. How you capture them is by removing the barriers to entry, streamlining the package management process, and massaging over papercuts that a brand-new user won't have the patience for.

The system installer disk image does give you an option to create an EXWM system (as well as GNOME, Xfce, etc).

This is awesome. :-D

5y agoHN ↗

This is from 5 minutes ago. I have both glibc-locales and glibc-utf8-locales installed:

/gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)

Right. The problem here is that you haven't updated the guix-daemon since you installed Guix. To get the fix rekado mentioned, you need to 'guix pull && guix upgrade' as root and restart the daemon.

(I can tell because you're using bash 5.0.7 from 1+ year ago)

You can also change the systemd service to use guix-daemon from your users Guix instead of 'root'. Arguably the installer could ask whether to do this, although users probably won't understand the security implications.

And, as I'm testing, I also notice that even for operations which require no changes, a guix pull takes 5 or more minutes over the equivalent nix operation. Why am I building guix-system for 5 minutes with nothing to be done?

That happens when there are no substitutes available for 'guix pull'. Work is ongoing in improving the compiler performance, but this is mostly "bad luck" (because you pulled a commit not yet built by the CI).

Wrt scriptability of the installer, IIUC the problem is that it returns "1" when a previous installation was detected? You can easily account for that in your "dotfiles up" script, no? Similarly, if you add the GPG key to your dotfiles you no longer have to download it every time.

5y agoHN ↗

Guix should lean into this one major strength and put out an Emacs-centered heavily opinionated installer image that uses EXWM for its window manager.

Wat?

While I live in Emacs I find it a terrible disservice to Guix to focus on this tiny niche. I'm probably biased, but one of the major strengths of Guix is its wealth of R packages that are all built reproducibly.

Ask different people about what they think is Guix's major strength and you'll get different answers, because Guix is pretty great in a lot of areas.

The installer script has seen some recent improvements and the interactive system installer as well. The annoying locales thing has also seen an unusual solution recently, so we're approaching a state where the initial impression lives up to the amazing day to day performance of Guix for package, environment, and system management.