What do I risk by using nixos-unstable?

NixOS is my only OS. My 21.05 install broke catastrophically a month or two ago – I could no longer boot the system, and had to reinstall. (GRUB offered me the usual menu of configurations, and I tried a few old ones as well as the most recent, but they had all stopped working.) That was shortly (a week? a month?) after I switched to nixos-unstable, and I’ve since suspected the two were related, but I’ll never know.

I’d like to have the most up-to-date software possible, but only subject to the condition that things don’t break. Would it be overly paranoid of me to stick with nixos-stable?

sounds strange. this sounds like disk corruption…what filesystem are/were you running…

not being able to rollback, sounds like something going catastrophically with your machine…

bad ram chips spring to mind causing the dreaded ‘disk churn’.

I track the latest stable release on my NixOS servers and even on Darwin. If there’s something I really want from nixos-unstable, I add it via an unstablePkgs attribute I pass in via specialArgs/extraSpecialArgs.

nixos-unstable is “unstable” because it makes no promises about which versions of packages will be in use. Stable versions try to only take bug fixes and security updates. Otherwise nixos-unstable is quite “stable”. It’s very odd that your system just stopped working. Can you post what went wrong?

4 Likes

I have been running nixos-unstable during the same time period and have did not encounter the same issue. I’m guessing the issue is relating to switching between 21.05 to unstable. It’s possible that nixos-rebuild did spit out an error but they can be hard to catch sometimes.

In my experience GRUB is pretty fragile since it depends on libraries living on /boot to be kept in exactly in sync with the grub EFI/binary you are using. GRUB also uses a configuration file on /boot that is generated by like 3 levels of shell scripts which can sometimes get messed up.

IMO systemd-boot is a lot simpler and less easily broken. You can enable it via the boot.loader.systemd-boot.enable option. It should work with all the normal boot options.

1 Like

what filesystem are/were you running…

@nixinator ext4, only because that’s the default is in the installation section of the NixOS manual.

bad ram chips spring to mind

@nixinator I did install new memory in it – it had 8GB to start and now has 16GB – and the extra 8 were surely not from Dell (the computer is a 2017 Dell Inspiron).

Can you post what went wrong?

@ElvishJerricco Alas, I’m afraid I can’t provide more detail. I normally take copious notes in org-roam, but I guess I don’t when my system is down.

If there’s something I really want from nixos-unstable, I add it via an unstablePkgs attribute I pass in via specialArgs/extraSpecialArgs.

@reckenrode Cool!

boot.loader.systemd-boot.enable

@Princemachiavelli Sonds good! I’ve currently got this in my configuration.nix file:

boot.loader = {
    grub = {
      enable = true;
      version = 2;
      devices = ["/dev/sda"]; # Where to put GRUB. "nodev" means EFI only.
      # configurationLimit = 15; # TODO ? Enable to save memory,
                                 # delete all but most recent history.
    };
  };

When you say “It should work with all the normal boot options,” I imagine you don’t mean I should leave those GRUB options in place and add boot.loader.systemd-boot.enable=true, right? Do you mean I can replace the GRUB section with the following?

boot.loader.systemd-boot = {
  enable = true;
  devices = ["/dev/sda"];
  configurationLimit = 15;
};

I boot in Legacy mode, if that’s relevant.

systemd-boot is EFI only, and the Grub options in NixOS don’t directly translate like that.

1 Like

It is all great with systemd-boot unitl you get “No space left on device”.

Becase systemd-boot places all linux kernel and initrd in EFI boot partition, you may quickly fill it up.

Mine partition is 100 MB.

I got Windows and Nixos.

And when I tried to add Nvidia, my system could not boot.

I needed to boot from live usb and use mount -o bind:

I should provably grow my partition to 1 GB, but this operation can be dangerous and I want my Windows to boot sometimes.

Here is my config nixfiles/configuration.nix at 3cf568599e3507a66dde972d0cddf5d48ef10c0f · rofrol/nixfiles · GitHub

This is the much easier way to deal with a full /boot:

nix-collect-garbage --delete-older-than 14d  # or some other value

Alternatively just remove a number of old generations from /nix/var/nix/profiles:

rm /nix/var/nix/profiles/system-some-old-generations # followed by
nix-store --delete /nix/store/whatever-the-various-old-generations-point-at

Then to clean up the old kernels/initrds:

/run/current-system/bin/switch-to-configuration boot

I tried deleting old generations but unfortunately it didn’t work
Maybr I did it wrong.

Hosted by Flying Circus.