-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
/
wrapper.nix
63 lines (52 loc) · 1.2 KB
/
wrapper.nix
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
62
63
{
lib,
wrapGAppsHook3,
glib,
stdenv,
xorg,
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.optionals useDefaultIndicators wingpanelIndicators);
in
stdenv.mkDerivation rec {
pname = "${wingpanel.pname}-with-indicators";
inherit (wingpanel) version;
src = null;
paths = [
wingpanel
] ++ selectedIndicators;
passAsFile = [ "paths" ];
nativeBuildInputs = [
glib
wrapGAppsHook3
];
buildInputs = lib.forEach selectedIndicators (x: x.buildInputs) ++ selectedIndicators;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
preferLocalBuild = true;
allowSubstitutes = false;
installPhase = ''
mkdir -p $out
for i in $(cat $pathsPath); do
${xorg.lndir}/bin/lndir -silent $i $out
done
'';
preFixup = ''
gappsWrapperArgs+=(
--set WINGPANEL_INDICATORS_PATH "$out/lib/wingpanel"
--set SWITCHBOARD_PLUGS_PATH "${switchboard-with-plugs}/lib/switchboard-3"
)
'';
inherit (wingpanel) meta;
}