about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix')
-rw-r--r--nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix27
1 files changed, 21 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
index 756ae86bb19d..cc6b37095fdb 100644
--- a/nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
+++ b/nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
@@ -1,23 +1,38 @@
-{ makeWrapper
+{ wrapGAppsHook
+, glib
+, lib
 , symlinkJoin
 , switchboard
 , switchboardPlugs
 , plugs
+  # Only useful to disable for development testing.
+, useDefaultPlugs ? true
 }:
 
 let
-  selectedPlugs = if plugs == null then switchboardPlugs else plugs;
+  selectedPlugs =
+    if plugs == null then switchboardPlugs
+    else plugs ++ (lib.optionals useDefaultPlugs switchboardPlugs);
 in
 symlinkJoin {
   name = "${switchboard.name}-with-plugs";
 
-  paths = [ switchboard ] ++ selectedPlugs;
+  paths = [
+    switchboard
+  ] ++ selectedPlugs;
 
-  buildInputs = [ makeWrapper ];
+  buildInputs = [
+    wrapGAppsHook
+    glib
+  ] ++ (lib.forEach selectedPlugs (x: x.buildInputs))
+    ++ selectedPlugs;
 
   postBuild = ''
-    wrapProgram $out/bin/io.elementary.switchboard \
-      --set SWITCHBOARD_PLUGS_PATH "$out/lib/switchboard"
+    make_glib_find_gsettings_schemas
+
+    gappsWrapperArgs+=(--set SWITCHBOARD_PLUGS_PATH "$out/lib/switchboard")
+
+    wrapGAppsHook
   '';
 
   inherit (switchboard) meta;