2020-04-24 23:36:52 +00:00
|
|
|
{ wrapGAppsHook
|
|
|
|
, glib
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, xorg
|
|
|
|
, switchboard
|
|
|
|
, switchboardPlugs
|
|
|
|
, plugs
|
|
|
|
# Only useful to disable for development testing.
|
|
|
|
, useDefaultPlugs ? true
|
2020-10-27 00:29:36 +00:00
|
|
|
, testName ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
selectedPlugs =
|
|
|
|
if plugs == null then switchboardPlugs
|
|
|
|
else plugs ++ (lib.optionals useDefaultPlugs switchboardPlugs);
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
testingName = lib.optionalString (testName != null) "${testName}-";
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-10-27 00:29:36 +00:00
|
|
|
name = "${testingName}${switchboard.name}-with-plugs";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = null;
|
|
|
|
|
|
|
|
paths = [
|
|
|
|
switchboard
|
|
|
|
] ++ selectedPlugs;
|
|
|
|
|
|
|
|
passAsFile = [ "paths" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
glib
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.forEach selectedPlugs (x: x.buildInputs)
|
|
|
|
++ selectedPlugs;
|
|
|
|
|
|
|
|
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"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit (switchboard) meta;
|
|
|
|
}
|
|
|
|
|