(Originally posted on XMonad failing to compile configuration on first login since 26.05 · nix-community/home-manager · Discussion #9380 · GitHub) but sharing here for more visibility.
My XMonad configuration is also a cabal package. Upgrading from 25.11 to 26.05, I’m now getting a “ghc could not be found” error because XMonad can’t build my configuration. My configuration is not configured via nix, but simply recursively linked to the destination.
Here are different combinations of the problem, depending on what package is available in the environment. Note that if I have XMonad with the correct packages in the system, invoking rebuild manually (with mod1+q) works, but the first compilation when logging in will still fail.
home.packages = [cabal-install];: “The program ‘ghc’ version >=7.0.1 is required but it could not be found.”home.packages = [ghc cabal-install];: “The package list for ‘hackage.haskell.org’ does not exist. Run ‘cabal update’ to download it.”home.packages = [ghc];: no error, but custom configuration is not loaded at all.home.packages = [];: no error, but custom configuration is not loaded at all.
Is this due to a misconfiguration on my side, or was a home-manager non backward compatible?
A reproducer is available here home-manager/test.nix at 3727b2cb5e3aacaf67e253bc6f21995c321eac8e · leana8959/home-manager · GitHub (less than 100 lines and very minimal, has autologin, booting up the machine is enough to show the error).
To run the reproducer, nix-build test.nix -A test.config.system.build.vm && ./result/bin/run-nixos-vm.
Thank you for reading my question ![]()