diff --git a/modules/targets/generic-linux.nix b/modules/targets/generic-linux.nix index b5a07d5f..fa263a12 100644 --- a/modules/targets/generic-linux.nix +++ b/modules/targets/generic-linux.nix @@ -26,6 +26,14 @@ in { GNU/Linux distributions other than NixOS. ''; }; + + enableKdeApplicationCache = mkEnableOption "" // { + description = '' + Whether to enable the management of the KDE application cache. + When using KDE Plasma, desktop applications installed via + home-manager may not appear in menus with this option disabled. + ''; + }; }; config = mkIf cfg.enable { @@ -103,5 +111,13 @@ in { TERMINFO_DIRS = "${profileDirectory}/share/terminfo:$TERMINFO_DIRS\${TERMINFO_DIRS:+:}${distroTerminfoDirs}"; }; + + home.activation.updateKdeApplicationCache = + if cfg.enableKdeApplicationCache then + hm.dag.entryAfter [ "installPackages" ] '' + run /usr/bin/kbuildsycoca5 --noincremental + '' + else + null; }; }