modules/desktop: add hidden apps option

This commit is contained in:
Max Headroom 2023-05-01 19:07:33 +02:00
parent 7c436d19f8
commit 14ab0f8a11
2 changed files with 27 additions and 0 deletions

View file

@ -7,6 +7,7 @@ in {
imports = [
./package-sets.nix
./nixpak-tricks.nix
./hidden-apps.nix
];
services.xserver = {

View file

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:
let
inherit (config.desktop) hiddenApps;
hiddenAppsPackage = pkgs.runCommandLocal "hidden-apps" {} ''
mkdir -p $out/share/applications
for app in ${lib.escapeShellArgs hiddenApps}; do
ln -sf /dev/null "$out/share/applications/$app"
done
'';
in
{
options.desktop = {
hiddenApps = lib.mkOption {
type = with lib.types; listOf str;
default = [];
};
};
config = lib.mkIf (hiddenApps != []) {
environment.systemPackages = [
(lib.hiPrio hiddenAppsPackage)
];
};
}