about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/mate/mate-panel/with-applets.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/desktops/mate/mate-panel/with-applets.nix')
-rw-r--r--nixpkgs/pkgs/desktops/mate/mate-panel/with-applets.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/desktops/mate/mate-panel/with-applets.nix b/nixpkgs/pkgs/desktops/mate/mate-panel/with-applets.nix
new file mode 100644
index 000000000000..e3f76645aa7c
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/mate/mate-panel/with-applets.nix
@@ -0,0 +1,61 @@
+{ 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);
+}