depot/third_party/nixpkgs/pkgs/desktops/mate/mate-panel/with-applets.nix
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

61 lines
1.2 KiB
Nix

{ stdenv
, lib
, glib
, wrapGAppsHook
, xorg
, marco
, mate-panel
, panelApplets
, applets ? [ ]
, useDefaultApplets ? true
}:
let
selectedApplets = applets ++ (lib.optionals useDefaultApplets panelApplets);
in
stdenv.mkDerivation {
pname = "${mate-panel.pname}-with-applets";
version = mate-panel.version;
src = null;
paths = [ mate-panel ] ++ selectedApplets;
passAsFile = [ "paths" ];
nativeBuildInputs = [
glib
wrapGAppsHook
];
buildInputs = lib.forEach selectedApplets (x: x.buildInputs) ++ selectedApplets
++ [ mate-panel ] ++ mate-panel.buildInputs ++ mate-panel.propagatedBuildInputs;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
preferLocalBuild = true;
allowSubstitutes = false;
installPhase = ''
runHook preInstall
mkdir -p $out
for i in $(cat $pathsPath); do
${xorg.lndir}/bin/lndir -silent $i $out
done
runHook postInstall
'';
preFixup = ''
gappsWrapperArgs+=(
--set MATE_PANEL_APPLETS_DIR "$out/share/mate-panel/applets"
--set MATE_PANEL_EXTRA_MODULES "$out/lib/mate-panel/applets"
# Workspace switcher settings
--prefix XDG_DATA_DIRS : "${glib.getSchemaDataDirPath marco}"
)
'';
inherit (mate-panel.meta);
}