When adding hyprland to nix configuration, the system no longer builds.
error:
… while calling the 'head' builtin
at /nix/store/k8nkf470zpidpa5nh76lh2x6rxfzpwa4-source/lib/attrsets.nix:1574:11:
1573| || pred here (elemAt values 1) (head values) then
1574| head values
| ^
1575| else
… while evaluating the attribute 'value'
at /nix/store/k8nkf470zpidpa5nh76lh2x6rxfzpwa4-source/lib/modules.nix:846:9:
845| in warnDeprecation opt //
846| { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
847| inherit (res.defsFinal') highestPrio;
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/store/k8nkf470zpidpa5nh76lh2x6rxfzpwa4-source/nixos/modules/system/activation/top-level.nix':
… while evaluating the option `warnings':
… while evaluating definitions from `/nix/store/k8nkf470zpidpa5nh76lh2x6rxfzpwa4-source/nixos/modules/config/xdg/portal.nix':
… while evaluating the option `xdg.portal.configPackages':
… while evaluating definitions from `/nix/store/k8nkf470zpidpa5nh76lh2x6rxfzpwa4-source/nixos/modules/programs/wayland/hyprland.nix':
… while evaluating the option `programs.hyprland.package':
… while evaluating definitions from `/nix/store/717ak5aizpfwqgpazzlgkqh6ywx4md5k-source/hosts/nitro/configuration.nix':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: adding a file to a tree builder: failed to insert entry: invalid object specified - VERSION
I did see that post and tried to use a different nix version. But it’s weird, this error just came out of nowhere. I used hyprland normally before.
I have absolutely no idea of what’s causing this. It apparently is a git error. Should I make an issue in the Nixpkgs github? Maybe it’s the hyprland’s repo fault?
I just ran nix flake update to update lock file. I tried using nix run nixpkgs#nixVersions.nix_2_20 -- flake update to try a different nix version but to no avail.
I’ve been intermittently getting the exact same error, and what fixes it for me is using nh to build my system. So instead of running nixos-rebuild, I do this:
$ nh os switch
(Except I’ve got that bound to an oss alias)
For me, that builds and activates the system without errors. What sort of magic nh is doing to achieve that, I do not know. I haven’t looked at what command(s) it’s running under the hood.
I installed nh by adding this to my system config: