From f6140c07b68273368ce4aad3e8b3fb1b849e10ab Mon Sep 17 00:00:00 2001 From: nevaforget <> Date: Fri, 7 Aug 2026 15:36:51 +0200 Subject: [PATCH] Do not deploy the empty kanshi config defaults/xdg/kanshi/config is a 0-byte placeholder, unused on Arch as well, where kanshi reads ~/.config/kanshi/config instead. Deploying it made kanshi fail to parse and restart in a loop. The unit now starts only when a user config exists. --- modules/desktop.nix | 5 ++++- modules/services.nix | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/desktop.nix b/modules/desktop.nix index 22f8563..78faada 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -65,7 +65,10 @@ in "xdg/quickshell/moonarch".source = "${xdg}/quickshell/moonarch"; "xdg/foot/foot.ini".source = "${xdg}/foot/foot.ini"; "xdg/fastfetch/config.jsonc".source = "${xdg}/fastfetch/config.jsonc"; - "xdg/kanshi/config".source = "${xdg}/kanshi/config"; + # defaults/xdg/kanshi/config is an empty placeholder — on Arch too. kanshi + # rejects it ("failed to parse config file") and restarts in a loop, so it + # is not deployed. Monitor profiles are machine specific and belong in + # ~/.config/kanshi/config. "xdg/Kvantum/kvantum.kvconfig".source = "${xdg}/Kvantum/kvantum.kvconfig"; "xdg/qt6ct/qt6ct.conf".source = "${xdg}/qt6ct/qt6ct.conf"; "xdg/gtk-3.0/settings.ini".source = "${xdg}/gtk-3.0/settings.ini"; diff --git a/modules/services.nix b/modules/services.nix index 5a5a6c6..1e43b83 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -34,6 +34,9 @@ partOf = [ "graphical-session.target" ]; after = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ]; + # Without a config kanshi exits with a parse error and, with + # Restart=on-failure, spins. Monitor profiles are per machine. + unitConfig.ConditionPathExists = "%h/.config/kanshi/config"; serviceConfig = { Type = "simple"; ExecStart = lib.getExe pkgs.kanshi;