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.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
new file mode 100644
index 000000000000..cc6b37095fdb
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
@@ -0,0 +1,39 @@
+{ 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 ++ (lib.optionals useDefaultPlugs switchboardPlugs);
+in
+symlinkJoin {
+  name = "${switchboard.name}-with-plugs";
+
+  paths = [
+    switchboard
+  ] ++ selectedPlugs;
+
+  buildInputs = [
+    wrapGAppsHook
+    glib
+  ] ++ (lib.forEach selectedPlugs (x: x.buildInputs))
+    ++ selectedPlugs;
+
+  postBuild = ''
+    make_glib_find_gsettings_schemas
+
+    gappsWrapperArgs+=(--set SWITCHBOARD_PLUGS_PATH "$out/lib/switchboard")
+
+    wrapGAppsHook
+  '';
+
+  inherit (switchboard) meta;
+}