`nixos-option` fails to build on 24.11, preventing update

I’m trying to update by Nix fails to do so. Here is my config. Here is the output of sudo nixos-rebuild switch --flake .:

💀  nix log /nix/store/q42q3px12lpinmakskvj90chbr4wavhj-nixos-option.drv
warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/q42q3px12lpinmakskvj90chbr4wavhj-nixos-option.drv^*'
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/gk2qs90xfhv0h19h8dca9hn9j3wkix6f-nixos-option
source root is nixos-option
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
mesonConfigurePhase flags: --prefix=/nix/store/rryvwj5r8x0xvc74dsx4k1f48b51678i-nixos-option --libdir>
The Meson build system
Version: 1.6.0
Source dir: /build/nixos-option
Build dir: /build/nixos-option/build
Build type: native build
Project name: nixos-option
Project version: 0.1.6
lines 1-18...skipping...
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/gk2qs90xfhv0h19h8dca9hn9j3wkix6f-nixos-option
source root is nixos-option
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
mesonConfigurePhase flags: --prefix=/nix/store/rryvwj5r8x0xvc74dsx4k1f48b51678i-nixos-option --libdir>
The Meson build system
Version: 1.6.0
Source dir: /build/nixos-option
Build dir: /build/nixos-option/build
Build type: native build
Project name: nixos-option
Project version: 0.1.6
C++ compiler for the host machine: g++ (gcc 13.3.0 "g++ (GCC) 13.3.0")
C++ linker for the host machine: g++ ld.bfd 2.43.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: YES (/nix/store/16h31npnbgpkhxp1041dsifiklbw4mpr-pkg-config-wrapper-0.29.2/bin/pkg->
Run-time dependency nix-main found: YES 2.18.9
Run-time dependency nix-store found: YES 2.18.9
Run-time dependency nix-expr found: YES 2.18.9
Run-time dependency nix-cmd found: YES 2.18.9
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency nix-flake found: NO (tried pkgconfig)

meson.build:10:16: ERROR: Dependency "nix-flake" not found, tried pkgconfig

I don’t know what I’m expected to do, cmake is already installed in my system. Isn’t nix-flake supposed to be available as a package tho?

Hard to spot from just the build logs without the switch context and all the additions/modifications to nixpkgs in your config.

FWIW, the flake-specific nix package (“nix-flake”) was deprecated since stable nix supports flakes these days. My best guess is that you’ve somehow ended up overriding nixos-option with a nixos-option from a nixpkgs before that deprecation, and as a result it tries to build with a dependency that doesn’t exist. It could also be incompatibility with the particular version of lix you end up with if you didn’t nix flake update. Flakehub obfuscates your inputs a bit, too (do you actually gain anything from using it only for nixpkgs/home-manager? Those projects have version branches anyway).

Also, you don’t need cmake installed system-wide, this is a nix package build, and done in complete isolation with packages downloaded automatically just for this purpose (without ever becoming available elsewhere). The fact that the build is even attempted means that your nixpkgs isn’t the upstream one, since that build would normally be cached and simply skipped.

The package is inherently broken, you need to find out what you did to nixpkgs to break it. I’d recommend commenting out overlays and references to unstable and working through that until you have a working build. A lot of your inputs are likely unnecesary at this point anyway, since switching to 24.11 probably brought you up to the point unstable/nixd/etc was at when you added all of that.

Do you Happen to use lix? I had the same issue and updating lix to the latest version helped.

Related issue: #580 - nixos-option build failure on lix 2.91.0 - lix-project/lix - Lix Systems

1 Like

Good catch, they seem to be using an overlay with lix here:

So the lix input should be updated accordingly:

Or just disable nixos-option since it doesn’t work with flakes anyway.


I feel like an idiot. I am confused why I can’t update either. I am not using flakes.

those errors in red give you the information needed; between the two releases, the configuration schema has changed and you need to move some options around in your configuration.nix file. The release notes will have additional details.

sudo nix-channel --list?

Also you really shouldn’t have a user nixos channel, that might confuse you and nix

1 Like

Those are just warnings, though.

@reese As NobbZ implied, if you run sudo nixos-rebuild, you’re running it as root, hence the root channels will be considered. So, the nix-channel command must be run as root too.

Though normally new issues should be a new topic :smiley:

oh, derp - yes, sorry…