Skip to content

4 packages raising "undefined variable" error #11

Open
@hazardous-sun

Description

@hazardous-sun

Hi there,

I'm migrating from Arch to Nix and I'm having a hard time on understanding Flakes.

I installed NixOS on my machine with the "No desktop" option. Then, I followed all the steps provided in the project's README.md file, but, when running sudo nixos-rebuild switch --flake /etc/nixos#nixos-notebook, an error message was raised, stating the following:

error: undefined variable 'surrealist'
at /nix/store/4lq861nz9q972zh5hlipdbzbqyjc1894-source/utils.nix:11:5

I tried to comment out surrealist, since it wasn't a package that important to me, then tried rerunning nixos-rebuild and it raised the same error, undefined variable, for hyprcursor. I found myself in a rabbit hole. I commented out 4 packages in total:

  • utils.nix:
    • surrealist
  • hyprland.nix:
    • hyprcursor
    • hyprlock
    • hypridle

After removing these packages I ran sudo nixos-rebuild switch --flake /etc/nixos#nixos-notebook again and it finished with the following message:

File system "/boot" is not a FAT EFI System Partition (ESP) file system.
systemd-boot not installed in ESP.
Traceback (most recent call last):
  File "/nix/store/va2wc83qm641zsa2f0hpn2kmi77ncq3x-systemd-boot", line 344 in <module>
    main()
  File "/nix/store/va2wc83qm641zsa2f0hpn2kmi77ncq3x-systemd-boot", line 322 in main
    install_bootloader(args)
  File "/nix/store/va2wc83qm641zsa2f0hpn2kmi77ncq3x-systemd-boot", line 270, in install_bootloader
    raise Exception("could not find any previously installed systemd-boot")
Exception: could not find any previously installed systemd-boot
warning: error(s) occurred while switching to the new configuration

(but it DID generate a new build)

I checked out and it seems that all the packages raising the "undefined variable" error are only available in the unstable branch of nixpkgs, but I noticed that the "flake.nix" already seems to maintain the unstable branch as the input for the flakes. Any idea on how to fix this one?

Also, I tried running sudo nixos-rebuild switch --flake /etc/nixos#nixos-notebook --show-trace > call_stack.txt but the content keeps being printed out in my CLI instead of being redirected to the file. Am I doing something wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions