nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
worldofpeace a9e7e93311 pantheon.switchboard-with-plugs: fix wrapping
Since #81475 this caused the wrapper to be empty of entries from
wrapGAppsHook because the wrapGAppsHook function doesn't add
them anymore, and was moved to gappsWrapperArgsHook. Instead
of just running that in postBuild it's more future proof to make this
use stdenv.mkDerivation because we want to mess around with the
generic builder.
2020-03-24 03:13:01 -04:00

59 lines
1,010 B
Nix

{ wrapGAppsHook
, glib
, lib
, stdenv
, xorg
, switchboard
, switchboardPlugs
, plugs
# Only useful to disable for development testing.
, useDefaultPlugs ? true
}:
let
selectedPlugs =
if plugs == null then switchboardPlugs
else plugs ++ (lib.optionals useDefaultPlugs switchboardPlugs);
in
stdenv.mkDerivation rec {
name = "${switchboard.name}-with-plugs";
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;
}