summary refs log tree commit diff
path: root/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix
blob: 6b554d89caa9f4ed9accf6ede6035f4c213f4e4b (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
{ lib
, makeWrapper
, symlinkJoin
, wingpanel
, wingpanelIndicators
, switchboard-with-plugs
, indicators ? null
}:

let
  selectedIndicators = if indicators == null then wingpanelIndicators else indicators;
in
symlinkJoin {
  name = "${wingpanel.name}-with-indicators";

  paths = [ wingpanel ] ++ selectedIndicators;

  buildInputs = [ makeWrapper ];

  # We have to set SWITCHBOARD_PLUGS_PATH because wingpanel-applications-menu
  # has a plugin to search switchboard settings
  postBuild = ''
    wrapProgram $out/bin/wingpanel \
      --set WINGPANEL_INDICATORS_PATH "$out/lib/wingpanel" \
      --set SWITCHBOARD_PLUGS_PATH "${switchboard-with-plugs}/lib/switchboard" \
      --suffix XDG_DATA_DIRS : ${lib.concatMapStringsSep ":" (indicator: ''${indicator}/share/gsettings-schemas/${indicator.name}'') selectedIndicators}
  '';

  inherit (wingpanel) meta;
}