I currently have some config files from my previous distro that I’d like to use, and I’m not yet ready to convert them all to .nix
files. For example, I have a ~/.config/rofi/config.rasi
file that I want to reuse. However, when I try running sudo nixos-rebuild switch
, I get an exit code from home-manager saying it would overwrite my files. I’ve seen the -b
flag, which forces the home-manager config files, but is there a way to nicely source my own instead?
I’ve seen stuff like home.file.".config/rofi/config.rasi".source = ~/.config/rofi/config.rasi;
but that doesn’t seem to be working (rebuilding still fails)
This is the output of journalctl -xe --unit home-manager-abhamra.service
A start job for unit home-manager-abhamra.service has begun execution.
░░
░░ The job identifier is 5831.
Jan 11 19:19:57 abhamra hm-activate-abhamra[14964]: Starting Home Manager activation
Jan 11 19:19:57 abhamra hm-activate-abhamra[14964]: Activating checkFilesChanged
Jan 11 19:19:57 abhamra hm-activate-abhamra[14964]: Activating checkLinkTargets
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: Existing file '/home/abhamra/.config/polybar/config.ini' is in the way of '/nix/store/xval5bjp887msr54i6yyb70bylidvc59-home-manager-files/.config/polybar/config.ini', will be skipped since they are the same
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: Existing file '/home/abhamra/.config/zathura/zathurarc' is in the way of '/nix/store/xval5bjp887msr54i6yyb70bylidvc59-home-manager-files/.config/zathura/zathurarc'
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: Existing file '/home/abhamra/.config/nvim/init.lua' is in the way of '/nix/store/xval5bjp887msr54i6yyb70bylidvc59-home-manager-files/.config/nvim/init.lua'
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: Existing file '/home/abhamra/.config/rofi/config.rasi' is in the way of '/nix/store/xval5bjp887msr54i6yyb70bylidvc59-home-manager-files/.config/rofi/config.rasi'
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: Please do one of the following:
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: - Move or remove the above files and try again.
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: - In standalone mode, use 'home-manager switch -b backup' to back up
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: files automatically.
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: - When used as a NixOS or nix-darwin module, set
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: 'home-manager.backupFileExtension'
Jan 11 19:19:57 abhamra hm-activate-abhamra[14985]: to, for example, 'backup' and rebuild.
Jan 11 19:19:57 abhamra systemd[1]: home-manager-abhamra.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit home-manager-abhamra.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Jan 11 19:19:57 abhamra systemd[1]: home-manager-abhamra.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit home-manager-abhamra.service has entered the 'failed' state with result 'exit-code'.
Jan 11 19:19:57 abhamra systemd[1]: Failed to start Home Manager environment for abhamra.
░░ Subject: A start job for unit home-manager-abhamra.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit home-manager-abhamra.service has finished with a failure.
░░
░░ The job identifier is 5831 and the job result is failed.
Thanks