Hi everyone.
I started with nix a couple of days ago and I love it so far.
I started to have issues with home-manager-user.service so I ended up not using it and moved my pkgs to configuration.nix.
The issue is that I still want to use home-manager but Idk how to solve it.
This is what nixos-rebuild shows as the error when trying to enable it again (currently I have it commented)
building the system configuration...
stopping the following units: accounts-daemon.service
activating the configuration...
setting up /etc...
reloading user units for $USER...
setting up tmpfiles
reloading the following units: dbus.service
restarting the following units: polkit.service
starting the following units: accounts-daemon.service
warning: the following units failed: home-manager-$USER.service
Ă— home-manager-&USER.service - Home Manager environment for $USER
Loaded: loaded (/etc/systemd/system/home-manager-$USER.service; enabled; preset: enabled)
Active: failed (Result: timeout) since Wed 2023-11-29 14:52:53 -03; 74ms ago
Process: 26539 ExecStart=/nix/store/8qcnp0d654fyfvn4yqyhmzmlzamr237i-hm-setup-env /nix/store/9v8c7ngs30rr91wyq8qd2gvd3q93qr4j-home-manager-generation (code=killed, signal=TERM)
Main PID: 26539 (code=killed, signal=TERM)
IP: 0B in, 0B out
CPU: 1.758s
nov 29 14:47:53 thinkpadp14s systemd[1]: Starting Home Manager environment for $USER...
nov 29 14:52:53 thinkpadp14s systemd[1]: home-manager-$USER.service: start operation timed out. Terminating.
nov 29 14:52:53 thinkpadp14s systemd[1]: home-manager-$USER.service: Main process exited, code=killed, status=15/TERM
nov 29 14:52:53 thinkpadp14s systemd[1]: home-manager-$USER.service: Failed with result 'timeout'.
nov 29 14:52:53 thinkpadp14s hm-activate-$USER[26545]: [32.2K blob data]
nov 29 14:52:53 thinkpadp14s systemd[1]: Failed to start Home Manager environment for $USER.
nov 29 14:52:53 thinkpadp14s systemd[1]: home-manager-$USER.service: Consumed 1.758s CPU time, no IP traffic.
warning: error(s) occurred while switching to the new configuration
My current config
NixOS 23.11
Nixpkgs 23.11
Home-manager 23.11
Flake is enabled
The time out means that one of your user services is failing to start. You can try systemctl status --user and look for the degraded services, or you could run journalctl --user -f before you switch and see the logs that way.
Assuming you use channels, did you remember to update your home-manager channel?
I’m sorry, i have no insight on this, but I just wanted to ask - is your username really $USER, or it was just not expanded for some reason (which probably causes the error in the first place)?
I’m sorry for the confusion.
I removed my real username to $USER to represent that the error should display the current user’s name so that my real username being there doesn’t make a difference
E.G. “home-manager-sirphobos.service”; which is how home-manager creates their service
You can use home-manager uninstall if you use it stand-alone, or remove the home-manager option (read: comment it out) from your system config if you use the NixOS module and rebuild.
That probably won’t change anything though, as nix should reproduce the exact same environment next time you install. The issue is most likely that one of the services launched by the home-manager service fails to start, which then causes systemd to report the home-manager service as failed, but doesn’t give you any logs for whatever other units have failed.
I’d suggest using the journalctl command I pointed out.