Home manager fails to start

having done some cleaning and re-organising of my current system, I wanted to test if it still worked (here is my current setup)
But running sudo nixos-rebuild switch --flake .#gobbe on it causes this error

building the system configuration...
activating the configuration...
setting up /etc...
reloading user units for gobbe...
restarting sysinit-reactivation.target
the following new units were started: NetworkManager-dispatcher.service
warning: the following units failed: home-manager-gobbe.service
Ă— home-manager-gobbe.service - Home Manager environment for gobbe
Loaded: loaded (/etc/systemd/system/home-manager-gobbe.service; enabled; preset: ignored)
Active: failed (Result: exit-code) since Sun 2025-11-16 23:55:24 CET; 258ms ago
Invocation: 35dc05d628864349beca5081bc401afc
Process: 114196 ExecStart=/nix/store/vsiyw9cslr18jddbhx7yxi5y3gb033px-hm-setup-env /nix/store/nl6jwpscpvjv815hfdmn007hnylmkzvk-home-manager-generation (code=exited, status=1/FAILURE)
Main PID: 114196 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
IO: 0B read, 0B written
Mem peak: 5.3M
CPU: 91ms

nov 16 23:55:24 nixos hm-activate-gobbe[114311]: Please do one of the following:
nov 16 23:55:24 nixos hm-activate-gobbe[114311]: - Move or remove the above files and try again.
nov 16 23:55:24 nixos hm-activate-gobbe[114311]: - In standalone mode, use 'home-manager switch -b backup' to back up
nov 16 23:55:24 nixos hm-activate-gobbe[114311]:   files automatically.
nov 16 23:55:24 nixos hm-activate-gobbe[114311]: - When used as a NixOS or nix-darwin module, set
nov 16 23:55:24 nixos hm-activate-gobbe[114311]:     'home-manager.backupFileExtension'
nov 16 23:55:24 nixos hm-activate-gobbe[114311]:   to, for example, 'backup' and rebuild.
nov 16 23:55:24 nixos systemd[1]: home-manager-gobbe.service: Main process exited, code=exited, status=1/FAILURE
nov 16 23:55:24 nixos systemd[1]: home-manager-gobbe.service: Failed with result 'exit-code'.
nov 16 23:55:24 nixos systemd[1]: Failed to start Home Manager environment for gobbe.
warning: error(s) occurred while switching to the new configuration

Systemd is cutting off the logs. Check systemctl status -n100 home-manager-$USER.service to hopefully get the part of the log saying which files are colliding.

2 Likes
Existing file '/home/gobbe/.config/fish/config.fish' is in the way of '/nix/store/myrr17xycb1qyw4hrx1yxwr8i4w9cywz-home-manager-files/.config/fish/config.fish'

I had fish installed from systempackages, but switched to home
seems like the old config files are still there
looks to me like it wants to be configured declaratively, while already being imperatively declared

Yeah, home-manager’s been configured to declaratively set the contents of that file, but there’s already a file there, and HM really doesn’t want to take the chance of destroying anything, so it just nopes out of the whole activation.

1 Like

Might just put fish back in systempkgs for time being, and add it back when I wanna dig into configuring it properly
honestly just happy it wasn’t anything serious
That error message was a goddamn jumpscare, glad to know it’s just “unfinished configs” :stuck_out_tongue:

More than likely it is because fish probably created a basic empty config on first run. You can inspect it to see if there’s anything you want to keep, then transfer it over. But you might have stuf like disabling the greeting and also setting a prompt or other stuff.