summary refs log tree commit diff
path: root/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
blob: 0abce809853555c0b9e1592c6b72e71d0fc5a872 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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.optional 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;
}