Failed to start Home Manager environment code=exited status=2

Hello, I’m currently trying to import a dotfile to my system. However when I build it I’m getting some error. Here are some of my logs:

May 06 17:11:57 tuhoiisapc systemd[1]: Failed to start Home Manager environment for tuhoiisa.
May 06 17:11:57 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Failed with result 'exit-code'.
May 06 17:11:57 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3745]: Activating fixDiscordModules
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3794]: [Nix] Disabling updates already done
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3745]: Activating disableDiscordUpdates
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3745]: Activating dconfSettings
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3745]: Activating installPackages
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3745]: Creating new profile generation
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3745]: Activating writeBoundary
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3745]: Activating hyprpanel
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3745]: Activating checkLinkTargets
May 06 17:11:57 tuhoiisapc hm-activate-tuhoiisa[3745]: Activating checkFilesChanged
May 06 17:11:56 tuhoiisapc hm-activate-tuhoiisa[3745]: Starting Home Manager activation
May 06 17:11:56 tuhoiisapc systemd[1]: Starting Home Manager environment for tuhoiisa...
May 06 15:59:26 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Consumed 189ms CPU time, 9.7M memory peak, 3.2M read from disk.
May 06 15:59:26 tuhoiisapc systemd[1]: Failed to start Home Manager environment for tuhoiisa.
May 06 15:59:26 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Failed with result 'exit-code'.
May 06 15:59:26 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1575]: Activating fixDiscordModules
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1687]: [Nix] Disabling updates already done
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1575]: Activating disableDiscordUpdates
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1575]: Activating dconfSettings
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1575]: Activating installPackages
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1575]: Creating new profile generation
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1575]: Activating writeBoundary
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1575]: Activating hyprpanel
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1575]: Activating checkLinkTargets
May 06 15:59:26 tuhoiisapc hm-activate-tuhoiisa[1575]: Activating checkFilesChanged
May 06 15:59:26 nixos hm-activate-tuhoiisa[1575]: Starting Home Manager activation
May 06 15:59:26 nixos systemd[1]: Starting Home Manager environment for tuhoiisa...
-- Boot 5f6867d37e714b30be4e04913a201256 --
May 06 15:27:33 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Consumed 214ms CPU time, 9.7M memory peak, 3.4M read from disk.
May 06 15:27:33 tuhoiisapc systemd[1]: Failed to start Home Manager environment for tuhoiisa.
May 06 15:27:33 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Failed with result 'exit-code'.
May 06 15:27:33 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1462]: Activating fixDiscordModules
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1701]: [Nix] Disabling updates already done
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1462]: Activating disableDiscordUpdates
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1462]: Activating dconfSettings
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1462]: Activating installPackages
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1462]: Creating new profile generation
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1462]: Activating writeBoundary
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1462]: Activating hyprpanel
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1646]: Existing file '/home/tuhoiisa/.config/hypr/hyprland.conf' is in the way of '/nix/store/w76jwilrd6a4imrpypv2vr1vg7w6wvg3-home-manager-files/.config/hypr/hyprland.conf', will be moved to '/home/tuhoiisa/.config/hypr/hyprland.conf.hm-backup'
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1462]: Activating checkLinkTargets
May 06 15:27:33 tuhoiisapc hm-activate-tuhoiisa[1462]: Activating checkFilesChanged
May 06 15:27:33 nixos hm-activate-tuhoiisa[1462]: Starting Home Manager activation
May 06 15:27:33 nixos systemd[1]: Starting Home Manager environment for tuhoiisa...
-- Boot e2a1c057c53540f09cc3845f08e52c08 --
May 06 15:23:11 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Consumed 159ms CPU time, 55.7M memory peak, 47.6M read from disk.
May 06 15:23:11 tuhoiisapc systemd[1]: Failed to start Home Manager environment for tuhoiisa.
May 06 15:23:11 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Failed with result 'exit-code'.
May 06 15:23:11 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[843]: Activating fixDiscordModules
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[1071]: [Nix] Disabling updates already done
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[843]: Activating disableDiscordUpdates
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[1047]: dbus-daemon[1047]: [session uid=1000 pid=1047] Successfully activated service 'ca.desrt.dconf'
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[1047]: dbus-daemon[1047]: [session uid=1000 pid=1047] Activating service name='ca.desrt.dconf' requested by ':1.0' (uid=1000 pid=1056 comm="/nix/store/f0vcfybp9gsif1q811xzlbjlwvb9sc57-dconf-" label="kernel")
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[843]: Activating dconfSettings
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[843]: Activating installPackages
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[843]: Creating new profile generation
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[843]: Activating writeBoundary
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[843]: Activating hyprpanel
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[843]: Activating checkLinkTargets
May 06 15:23:11 tuhoiisapc hm-activate-tuhoiisa[843]: Activating checkFilesChanged
May 06 15:23:10 tuhoiisapc hm-activate-tuhoiisa[843]: Starting Home Manager activation
May 06 15:23:10 tuhoiisapc systemd[1]: Starting Home Manager environment for tuhoiisa...
-- Boot 717feab68fa245faa66ee60f41edf4d7 --
May 06 00:02:57 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Consumed 218ms CPU time, 7.8M memory peak, 1.2M read from disk.
May 06 00:02:57 tuhoiisapc systemd[1]: Failed to start Home Manager environment for tuhoiisa.
May 06 00:02:57 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Failed with result 'exit-code'.
May 06 00:02:57 tuhoiisapc systemd[1]: home-manager-tuhoiisa.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3330]: Activating fixDiscordModules
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3590]: [Nix] Disabled updates
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3330]: Activating disableDiscordUpdates
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3330]: Activating dconfSettings
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3330]: Activating installPackages
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3330]: Creating new profile generation
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3330]: Activating writeBoundary
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3330]: Activating hyprpanel
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3330]: Activating checkLinkTargets
May 06 00:02:57 tuhoiisapc hm-activate-tuhoiisa[3330]: Activating checkFilesChanged
May 06 00:02:56 nixos hm-activate-tuhoiisa[3330]: Starting Home Manager activation
May 06 00:02:56 nixos systemd[1]: Starting Home Manager environment for tuhoiisa...

Dotfiles repo:GitHub - tuhoiisa/nixos-config: My nixos config based on https://github.com/anotherhadi/nixy
Conversation made with dotfile owner:Config wont apply user specific settings (hyprland theme, shell etc) · Issue #23 · anotherhadi/nixy · GitHub

Share the logs from journalctl -xe --user --unit home-manager-tuhoiisa.service

1 Like

Looks like a discord module causing it. It’s working good after uncommenting it.

This likely means it’s trying to create a file which already exists. The home-manager deployment is failing midway through; this is a common thing with home-manager since it tries to protect your data. Deployments with home-manager are far from atomic.

Please share the logs I asked for; sadly nixos-rebuild swallows a lot of the home-manager outpt, it shows up in the journal though.