diff --git a/modules/services/kanshi.nix b/modules/services/kanshi.nix index 2eda7487629c..f90adf14f9f0 100644 --- a/modules/services/kanshi.nix +++ b/modules/services/kanshi.nix @@ -332,11 +332,13 @@ in { { home.packages = [ cfg.package ]; - xdg.configFile."kanshi/config".text = - if cfg.profiles == { } && cfg.extraConfig == "" then - directivesStr - else - oldDirectivesStr; + xdg.configFile."kanshi/config" = let + generatedConfigStr = + if cfg.profiles == { } && cfg.extraConfig == "" then + directivesStr + else + oldDirectivesStr; + in mkIf (generatedConfigStr != "") { text = generatedConfigStr; }; systemd.user.services.kanshi = { Unit = {