modules/desktop: add hidden apps option
This commit is contained in:
parent
7c436d19f8
commit
14ab0f8a11
2 changed files with 27 additions and 0 deletions
|
@ -7,6 +7,7 @@ in {
|
|||
imports = [
|
||||
./package-sets.nix
|
||||
./nixpak-tricks.nix
|
||||
./hidden-apps.nix
|
||||
];
|
||||
|
||||
services.xserver = {
|
||||
|
|
26
modules/desktop/hidden-apps.nix
Normal file
26
modules/desktop/hidden-apps.nix
Normal 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)
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue