summary refs log tree commit diff
path: root/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix
blob: a46a26cc9ea539916318a61b537644503a63d2d6 (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
{ lib
, wrapGAppsHook
, glib
, symlinkJoin
, wingpanel
, wingpanelIndicators
, switchboard-with-plugs
, indicators ? null
  # Only useful to disable for development testing.
, useDefaultIndicators ? true
}:

let
  selectedIndicators =
    if indicators == null then wingpanelIndicators
    else indicators ++ (lib.optional useDefaultIndicators wingpanelIndicators);
in
symlinkJoin {
  name = "${wingpanel.name}-with-indicators";

  paths = [
    wingpanel
  ] ++ selectedIndicators;

  buildInputs = [
    glib
    wrapGAppsHook
  ] ++ (lib.forEach selectedIndicators (x: x.buildInputs))
    ++ selectedIndicators;

  # We have to set SWITCHBOARD_PLUGS_PATH because wingpanel-applications-menu
  # has a plugin to search switchboard settings
  postBuild = ''
    make_glib_find_gsettings_schemas

    gappsWrapperArgs+=(
      --set WINGPANEL_INDICATORS_PATH "$out/lib/wingpanel"
      --set SWITCHBOARD_PLUGS_PATH "${switchboard-with-plugs}/lib/switchboard"
    )

    wrapGAppsHook
  '';

  inherit (wingpanel) meta;
}