Couldn't nixos-rebuild: error: cython-0.29.37.1 not supported for interpreter python3.13

I updated recently, and now, running nixos-rebuild results in this error:

error:
       … while calling the 'head' builtin
         at /nix/store/igmrb3hj6wr27ll3nlgjfaawf5jsjvji-source/lib/attrsets.nix:1534:13:
         1533|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1534|             head values
             |             ^
         1535|           else

       … while evaluating the attribute 'value'
         at /nix/store/igmrb3hj6wr27ll3nlgjfaawf5jsjvji-source/lib/modules.nix:1086:7:
         1085|     // {
         1086|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |       ^
         1087|       inherit (res.defsFinal') highestPrio;

       … while evaluating the option `system.build.toplevel':

       … while evaluating definitions from `/nix/store/igmrb3hj6wr27ll3nlgjfaawf5jsjvji-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating the option `warnings':

       … while evaluating definitions from `/nix/store/igmrb3hj6wr27ll3nlgjfaawf5jsjvji-source/nixos/modules/system/boot/systemd.nix':

       … while evaluating the option `systemd.services.home-manager-n3rdium.serviceConfig':

       … while evaluating definitions from `/nix/store/70rg0z7glhanwg8rwg24cl5x75kdd322-source/nixos':

       … while evaluating the option `home-manager.users.n3rdium.home.file."/home/n3rdium/.config/fontconfig/conf.d/10-hm-fonts.conf".source':

       … while evaluating definitions from `/nix/store/70rg0z7glhanwg8rwg24cl5x75kdd322-source/modules/files.nix':

       … while evaluating the option `home-manager.users.n3rdium.home.file."/home/n3rdium/.config/fontconfig/conf.d/10-hm-fonts.conf".text':

       … while evaluating definitions from `/nix/store/70rg0z7glhanwg8rwg24cl5x75kdd322-source/modules/misc/xdg.nix':

       … while evaluating the option `home-manager.users.n3rdium.xdg.configFile."fontconfig/conf.d/10-hm-fonts.conf".text':

       … while evaluating definitions from `/nix/store/70rg0z7glhanwg8rwg24cl5x75kdd322-source/modules/misc/fontconfig.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: cython-0.29.37.1 not supported for interpreter python3.13
Command '['nix', '--extra-experimental-features', 'nix-command flakes', 'build', '--print-out-paths', 'git+file:///home/n3rdium/.dotfiles#nixosConfigurations."n3rdium".config.system.build.toplevel', '--no-link']' returned non-zero exit status 1.
4 Likes

I think this problem comes from nix migrating to python3.13.
I spent some time looking at nixpkgs’s .nix files looking if any of the apps I have installed had Cython as dependancy, but found nothing. (Also that might not be the way to look for dependancies)

I solved this by restoring my flake.lock file to a previous version.

Inside nix flake repo:

Find in which commit lock was updated

git log -- flake.lock
copy the latest hash that doesn’t ends with (HEAD -> Main) (Main or your branch’s name)

If you want to be sure that the lock changed in that commit:

git diff commitHash flake.lock

Restore lock

git checkout commitHash flake.lock

I know this might not be the best solution, but I hope it helps until someone that really knows can solve this problem.
(Or maybe Cython fix itself to support python 3.13)

1 Like

Fixed this temporarily by removing the lmms package.
It depends on the carla library which depends on liblo, which is the root cause of this error. I guess I have to wait for it to be fixed before I can use lmms again?