1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 nix-update-script,
6 desktop-file-utils,
7 gettext,
8 pkg-config,
9 gnome-keyring,
10 gnome-session,
11 wingpanel,
12 orca,
13 onboard,
14 elementary-default-settings,
15 gnome-settings-daemon,
16 runtimeShell,
17 systemd,
18 writeText,
19 meson,
20 ninja,
21}:
22stdenv.mkDerivation rec {
23 pname = "elementary-session-settings";
24 version = "8.0.1";
25
26 src = fetchFromGitHub {
27 owner = "elementary";
28 repo = "session-settings";
29 rev = version;
30 sha256 = "sha256-4B7lUjHEa4LdKrmsFCB3iFIsdVd/rgwmtQUAgAj3rXs=";
31 };
32
33 /*
34 This allows `elementary-session-settings` to not use gnome-keyring's ssh capabilities anymore, as they have been
35 moved to gcr upstream, in an effort to modularize gnome-keyring.
36
37 More info can be found here: https://gitlab.gnome.org/GNOME/gnome-keyring/-/merge_requests/60
38 */
39 patches = [ ./no-gnome-keyring-ssh-autostart.patch ];
40
41 nativeBuildInputs = [
42 desktop-file-utils
43 gettext
44 meson
45 ninja
46 pkg-config
47 ];
48
49 buildInputs = [
50 gnome-keyring
51 gnome-settings-daemon
52 onboard
53 orca
54 systemd
55 ];
56
57 mesonFlags = [
58 "-Dmimeapps-list=false"
59 "-Dfallback-session=GNOME"
60 "-Ddetect-program-prefixes=true"
61 "--sysconfdir=${placeholder "out"}/etc"
62 "-Dwayland=true"
63 ];
64
65 postInstall = ''
66 # our mimeapps patched from upstream to exclude:
67 # * evince.desktop -> org.gnome.Evince.desktop
68 mkdir -p $out/share/applications
69 cp -av ${./pantheon-mimeapps.list} $out/share/applications/pantheon-mimeapps.list
70
71 # absolute path patched sessions
72 substituteInPlace $out/share/{xsessions/pantheon.desktop,wayland-sessions/pantheon-wayland.desktop} \
73 --replace-fail "Exec=gnome-session" "Exec=${gnome-session}/bin/gnome-session" \
74 --replace-fail "TryExec=io.elementary.wingpanel" "TryExec=${wingpanel}/bin/io.elementary.wingpanel"
75 '';
76
77 passthru = {
78 updateScript = nix-update-script { };
79
80 providedSessions = [
81 "pantheon"
82 "pantheon-wayland"
83 ];
84 };
85
86 meta = with lib; {
87 description = "Session settings for elementary";
88 homepage = "https://github.com/elementary/session-settings";
89 license = licenses.gpl2Plus;
90 platforms = platforms.linux;
91 teams = [ teams.pantheon ];
92 };
93}