Error in nixos-rbuild-ng on fresh system with minimal configuration

Hello,

Hello, I’m new to NixOS and im just expirementing in a VM and on an old laptop. I’m getting this output when trying to build and I have no idea what this means (seems like some internal error?):

[isak@nixos:~/nix]$ sudo nixos-rebuild switch --flake .#isak-vm-nixos
[sudo] password for isak:
/nix/store/lpw4dp0d0rj7m8iy9gfpqi834wf0aaak-nixos-rebuild-ng-0.0.0/bin/.nixos-rebuild-wrapped: /nix/store/lpw4dp0d0rj7m8iy9gfpqi834wf0aaak-nixos-rebuild-ng-0.0.0/bin/nixos-rebuild: line 3: syntax error near unexpected token `lambda'
/nix/store/lpw4dp0d0rj7m8iy9gfpqi834wf0aaak-nixos-rebuild-ng-0.0.0/bin/.nixos-rebuild-wrapped: /nix/store/lpw4dp0d0rj7m8iy9gfpqi834wf0aaak-nixos-rebuild-ng-0.0.0/bin/nixos-rebuild: line 3: `import sys;import site;import functools;sys.argv[0] = '/nix/store/lpw4dp0d0rj7m8iy9gfpqi834wf0aaak-nixos-rebuild-ng-0.0.0/bin/nixos-rebuild';functools.reduce(lambda k, p: site.addsitedir(p, k), ['/nix/store/lpw4dp0d0rj7m8iy9gfpqi834wf0aaak-nixos-rebuild-ng-0.0.0/lib/python3.13/site-packages'], site._init_pathinfo());'

This is the minimal flake I’m using: https://github.com/isak102/nixos-config

I’m getting this in a VM and on my laptop. I am using the 25.05 x86 ISO from the official website.

This exact flake worked in a VM on my laptop just a few days ago

Your repository is private, but yeah, this is a python error afaict. Most likely store corruption, have a look at this part of the manual: nix store repair - Nix Reference Manual