Very strange "nixos-rebuild switch --upgrade" problem currently

So I have a System76 tower, I thought I was pretty decent at Nix troubleshooting… until now.
FYI my local config is not completely Flake-ified yet, my configuration.nix still depends on channels. The main channel is unstable. 99% of the time, everything works great… But then today there’s this:

It seems like “extra-utils” (which is some low-level kernel thing? It doesn’t even show up as an available package on search.nixos.org) is not being built “purely” and is trying to refer to a store path it’s not allowed to. This seems extremely unusual…

EDIT: It seems highly related to `extra-utils` is not allowed to refer to the following paths `util-linux-2.39-mount` · Issue #243820 · NixOS/nixpkgs · GitHub ; I’m also running root on ZFS…

Unstable does break on occasion. This is where using flakes can be highly useful. You can bump the unstable pin, if it fails to build just revert and try again in a week or so. But yeah, it looks like you are trying to build the entire linux kernel, which means either there is a breakage in the build chain, as you pointed out in your linked issue, or hydra hasn’t had a chance to build and upload the kernel yet. Either way I would just hold off on updating until it is resolved, unless you have the experience to attempt a fix in nixpkgs proper.

1 Like

yeah, I absolutely want to move to flakes for this and other reasons, but I just haven’t had time to get it working yet (I think overlays were the most recent hangup). I bet someone knowledgeable could take 1 look at my configuration and go “oh, all you have to do is …” and boom!

I’ve have the same issue on 2 machines - 1 Intel / Nvidia, the other AMD/AMD. I have a 3rd machine with almost identical config to the AMD/AMD machine, but with systemd boot rather than grub. The 3rd rebuilds without error, although from experience grub may not be the package at fault…

There isn’t anything you really have to do to migrate to flakes unless you use a lot of impure commands like builtins.getEnv or <nixpkgs> expansions a lot. Even so those are easy to fix, otherwise to actually migrate the configuration is almost a no-op. You just need a flake like this and you can simply import your existing configuration.nix pretty trivially:

# flake.nix
{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  outputs = { nixpkgs, ... }: {
    nixosConfigurations.mySystem = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [ ./path/to/configuration.nix ];
   };
}

You can refactor the code later if you wish, but that’d get you going.

1 Like