3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.1 KiB
Nix
Raw Normal View History

{ wrapGAppsHook
, glib
, lib
, stdenv
, xorg
, switchboard
, switchboardPlugs
, plugs
# Only useful to disable for development testing.
, useDefaultPlugs ? true
, testName ? null
}:
2018-08-20 21:31:18 +01:00
let
selectedPlugs =
if plugs == null then switchboardPlugs
else plugs ++ (lib.optionals useDefaultPlugs switchboardPlugs);
testingName = lib.optionalString (testName != null) "${testName}-";
2018-08-20 21:31:18 +01:00
in
stdenv.mkDerivation rec {
2022-03-01 10:39:32 +00:00
pname = "${testingName}${switchboard.pname}-with-plugs";
inherit (switchboard) version;
2018-08-20 21:31:18 +01:00
src = null;
paths = [
switchboard
] ++ selectedPlugs;
2018-08-20 21:31:18 +01:00
passAsFile = [ "paths" ];
nativeBuildInputs = [
glib
wrapGAppsHook
];
buildInputs = lib.forEach selectedPlugs (x: x.buildInputs)
++ selectedPlugs;
2018-08-20 21:31:18 +01:00
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 SWITCHBOARD_PLUGS_PATH "$out/lib/switchboard"
)
2018-08-20 21:31:18 +01:00
'';
inherit (switchboard) meta;
}