Cannot rebuild switch any more with no changes in my config

As I have done before I decided to do an update. I have a flaked system so first I ran “nix flake update” which didn’t seem to have any issues. However when I run “nixos-rebuild switch --flake .#system” now I get an error and I don’t understand why as I haven’t actually changed anything.

The error is as follows:

error:
       … while calling the 'seq' builtin

         at /nix/store/6viki0xn0rpxw1spfn1kp1ii2s19v75x-source/lib/modules.nix:320:18:

          319|         options = checked options;
          320|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          321|         _module = checked (config._module);

       … while calling the 'throw' builtin

         at /nix/store/6viki0xn0rpxw1spfn1kp1ii2s19v75x-source/lib/modules.nix:296:18:

          295|                     ''
          296|             else throw baseMsg
             |                  ^
          297|         else null;

       error: The option `hardware.amdgpu' does not exist. Definition values:
       - In `/nix/store/m8sxm74cc4vq3bv1n9rzp14ygbh8lbgg-source/common/gpu/amd':
           {
             initrd = {
               enable = {
                 _type = "override";
                 content = true;

My input flakes that may be relevant are

    nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2311.tar.gz";

    nixpkgs-unstable.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.tar.gz";

    nixos-hardware.url = "https://flakehub.com/f/NixOS/nixos-hardware/0.1.tar.gz";

I suspect the latter may be the issue from the error.

I call the following module for this host.

inputs.nixos-hardware.nixosModules.framework-13-7040-amd

Have I done something stupid or is this an upstream issue?

You’re running NixOS 23.11 with nixos-hardware master. Whatever commit of nixos-hardware flakehub actually gives you does not support NixOS 23.11. NixOS 23.11 is also no longer supported and gets no security updates, so you should switch away from that either way.

Not sure if flakehub is particularly useful here, you’re getting zero benefits if you’re not going to pin specific semver-style versions anyway (you’re just grabbing a specific nixpkgs branch and master for the other two inputs), while being inconsistent with the ecosystem’s inputs, making your flake harder to grok, and using proprietary tooling.

It’s also impossible to tell whether you’re using a nixpkgs-* or a nixos-* branch here, my guess is the former since flakehub is probably more useful for non-NixOS topics, while for a NixOS config you should use the latter, since it involves testing more NixOS-related things.

3 Likes

Ah I see. This is where I’m being hurt by not truly understanding my own code as I pinched bits from a variety of places.

Let’s say I’m keen to upgrade to the latest NixOS. Is it just a case of pointing it at the correct input flake or is there more to it?

Thanks though, working through this will help me understand a bit better I think

1 Like

Mostly. I would recommend looking at the release notes before deploying, it’ll help you migrate any incompatibilities, and warn you if there’s anything important to keep in mind.

Also remember to nixos-rebuild boot rather than switch, much less risky with kernel version changes.

Feel free to ask if there’s more you need a hand with!

1 Like

I’ve not come across nixos-rebuild boot. Did that use the same flake syntax as switch?

Yep, it’s exactly the same, except it skips running the activation script, so your system will only switch to the new config on reboot.

1 Like

Just to confirm that I got this working so thanks for your help. I updated my flake

 nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
 nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
 nixos-hardware.url = "github:NixOS/nixos-hardware";

And a couple of other flakes like home manager. It threw up some very useful and easy to understand warnings about parameters which had changed. Once I updated these it built cleanly and I now have an updated system.

Thanks for your help

1 Like