Unable to nixos-rebuild after changing KDE settings using the GUI.
I changed some font settings using the GUI and that changed the 10-hm-fonts.conf
file inside the .config
folder according to my investigation.
Before (also the contents of /nix/store/wwrpv7asn1md5izislwpyq3p9i4wks0q-home-manager-files/.config/fontconfig/conf.d/10-hm-fonts.conf
):
<?xml version='1.0'?>
<!-- Generated by Home Manager. -->
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
<description>Add fonts in the Nix user profile</description>
<include ignore_missing="yes">/nix/store/dklxishdaqr1s2dghi13525h7rw11whl-home-manager-path/etc/fonts/conf.d</include>
<include ignore_missing="yes">/nix/store/dklxishdaqr1s2dghi13525h7rw11whl-home-manager-path/etc/fonts/fonts.conf</include>
<dir>/nix/store/dklxishdaqr1s2dghi13525h7rw11whl-home-manager-path/lib/X11/fonts</dir>
<dir>/nix/store/dklxishdaqr1s2dghi13525h7rw11whl-home-manager-path/share/fonts</dir>
<dir>/etc/profiles/per-user/nixuser/lib/X11/fonts</dir>
<dir>/etc/profiles/per-user/nixuser/share/fonts</dir>
<cachedir>/nix/store/dklxishdaqr1s2dghi13525h7rw11whl-home-manager-path/lib/fontconfig/cache</cachedir>
</fontconfig>
After:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<!-- Generated by Home Manager. -->
<fontconfig>
<description>Add fonts in the Nix user profile</description>
<include ignore_missing="yes">/nix/store/bbbf330zjg84shn08y4rqxhzldpfrqkf-home-manager-path/etc/fonts/conf.d</include>
<include ignore_missing="yes">/nix/store/bbbf330zjg84shn08y4rqxhzldpfrqkf-home-manager-path/etc/fonts/fonts.conf</include>
<dir>/nix/store/bbbf330zjg84shn08y4rqxhzldpfrqkf-home-manager-path/lib/X11/fonts</dir>
<dir>/nix/store/bbbf330zjg84shn08y4rqxhzldpfrqkf-home-manager-path/share/fonts</dir>
<dir>/etc/profiles/per-user/nixuser/lib/X11/fonts</dir>
<dir>/etc/profiles/per-user/nixuser/share/fonts</dir>
<cachedir>/nix/store/bbbf330zjg84shn08y4rqxhzldpfrqkf-home-manager-path/lib/fontconfig/cache</cachedir>
<match target="font">
<edit mode="assign" name="rgba">
<const>bgr</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintfull</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
</match>
</fontconfig>
Command used: sudo nixos-rebuild switch
Terminal Output:
sudo nixos-rebuild switch
building the system configuration...
activating the configuration...
setting up /etc...
reloading user units for nixuser...
setting up tmpfiles
restarting the following units: home-manager-nixuser.service
Job for home-manager-nixuser.service failed because the control process exited with error code.
See "systemctl status home-manager-nixuser.service" and "journalctl -xeu home-manager-nixuser.service" for details.
warning: the following units failed: home-manager-nixuser.service
× home-manager-nixuser.service - Home Manager environment for nixuser
Loaded: loaded (/etc/systemd/system/home-manager-nixuser.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-03-19 17:44:01 +06; 136ms ago
Duration: 6min 42.464s
Process: 27100 ExecStart=/nix/store/b7zkhbiryc17dfi1f9bg2lznm1lzb87l-hm-setup-env /nix/store/5gq26lag1dzd3b7gzswqbyyx63bvx32j-home-manager-generation (code=exited, status=1/FAILURE)
Main PID: 27100 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
CPU: 103ms
Mar 19 17:44:01 nixos systemd[1]: Starting Home Manager environment for nixuser...
Mar 19 17:44:01 nixos hm-activate-nixuser[27100]: Starting Home Manager activation
Mar 19 17:44:01 nixos hm-activate-nixuser[27100]: Activating checkFilesChanged
Mar 19 17:44:01 nixos hm-activate-nixuser[27100]: Activating checkLinkTargets
Mar 19 17:44:01 nixos hm-activate-nixuser[27186]: Existing file '/home/nixuser/.config/fontconfig/conf.d/10-hm-fonts.conf' is in the way of '/nix/store/wwrpv7asn1md5izislwpyq3p9i4wks0q-home-manager-files/.config/fontconfig/conf.d/10-hm-fonts.conf'
Mar 19 17:44:01 nixos hm-activate-nixuser[27186]: Please move the above files and try again or use 'home-manager switch -b backup' to back up existing files automatically.
Mar 19 17:44:01 nixos systemd[1]: home-manager-nixuser.service: Main process exited, code=exited, status=1/FAILURE
Mar 19 17:44:01 nixos systemd[1]: home-manager-nixuser.service: Failed with result 'exit-code'.
Mar 19 17:44:01 nixos systemd[1]: Failed to start Home Manager environment for nixuser.
warning: error(s) occurred while switching to the new configuration
I’ve confirmed that this the issue as restoring the 10-hm-fonts.conf
back to it’s original state causes no error and the rebuild to succeed.
System information
- system: `"x86_64-linux"`
- host os: `Linux 6.1.82, NixOS, 23.11 (Tapir), 23.11.20240316.8ac30a3`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.18.1`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`