2023-05-01 20:07:33 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (config.desktop) hiddenApps;
|
|
|
|
|
2023-05-01 22:25:15 +03:00
|
|
|
hiddenDesktopFile = pkgs.writeText "hidden.desktop" ''
|
|
|
|
[Desktop Entry]
|
|
|
|
Hidden=true
|
|
|
|
NoDisplay=true
|
|
|
|
'';
|
2023-05-01 20:07:33 +03:00
|
|
|
hiddenAppsPackage = pkgs.runCommandLocal "hidden-apps" {} ''
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
for app in ${lib.escapeShellArgs hiddenApps}; do
|
2023-05-01 22:25:15 +03:00
|
|
|
ln -sf ${hiddenDesktopFile} "$out/share/applications/$app"
|
2023-05-01 20:07:33 +03:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options.desktop = {
|
|
|
|
hiddenApps = lib.mkOption {
|
|
|
|
type = with lib.types; listOf str;
|
|
|
|
default = [];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = lib.mkIf (hiddenApps != []) {
|
|
|
|
environment.systemPackages = [
|
|
|
|
(lib.hiPrio hiddenAppsPackage)
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|