summary refs log tree commit diff
path: root/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/desktops/pantheon/apps/switchboard/wrapper.nix')
-rw-r--r--pkgs/desktops/pantheon/apps/switchboard/wrapper.nix38
1 files changed, 29 insertions, 9 deletions
diff --git a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
index cc6b37095fd..67f4105ff3d 100644
--- a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
+++ b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
@@ -1,7 +1,8 @@
 { wrapGAppsHook
 , glib
 , lib
-, symlinkJoin
+, stdenv
+, xorg
 , switchboard
 , switchboardPlugs
 , plugs
@@ -14,26 +15,45 @@ let
     if plugs == null then switchboardPlugs
     else plugs ++ (lib.optionals useDefaultPlugs switchboardPlugs);
 in
-symlinkJoin {
+stdenv.mkDerivation rec {
   name = "${switchboard.name}-with-plugs";
 
+  src = null;
+
   paths = [
     switchboard
   ] ++ selectedPlugs;
 
-  buildInputs = [
-    wrapGAppsHook
+  passAsFile = [ "paths" ];
+
+  nativeBuildInputs = [
     glib
-  ] ++ (lib.forEach selectedPlugs (x: x.buildInputs))
+    wrapGAppsHook
+  ];
+
+  buildInputs = lib.forEach selectedPlugs (x: x.buildInputs)
     ++ selectedPlugs;
 
-  postBuild = ''
-    make_glib_find_gsettings_schemas
+  dontUnpack = true;
+  dontConfigure = true;
+  dontBuild = true;
 
-    gappsWrapperArgs+=(--set SWITCHBOARD_PLUGS_PATH "$out/lib/switchboard")
+  preferLocalBuild = true;
+  allowSubstitutes = false;
 
-    wrapGAppsHook
+  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;
 }
+