about summary refs log tree commit diff
path: root/pkgs/desktops/mate/mate-panel/with-applets.nix
blob: e3f76645aa7c7f7d54b17d6273818a6debb920d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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);
}