2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv
|
2018-05-06 20:57:45 +02:00
|
|
|
, autoreconfHook
|
|
|
|
, fetchurl
|
|
|
|
, gettext
|
|
|
|
, glib
|
|
|
|
, gnome-bluetooth
|
|
|
|
, gnome-desktop
|
2019-01-09 09:52:58 +01:00
|
|
|
, gnome-panel
|
2018-05-06 20:57:45 +02:00
|
|
|
, gnome-session
|
2021-05-07 23:18:14 +02:00
|
|
|
, gnome
|
2018-05-06 20:57:45 +02:00
|
|
|
, gsettings-desktop-schemas
|
2019-02-13 22:47:50 +01:00
|
|
|
, gtk3
|
2018-05-06 20:57:45 +02:00
|
|
|
, ibus
|
|
|
|
, libcanberra-gtk3
|
|
|
|
, libpulseaudio
|
|
|
|
, libxkbfile
|
|
|
|
, libxml2
|
2021-01-17 03:21:50 +01:00
|
|
|
, pkg-config
|
2018-05-06 20:57:45 +02:00
|
|
|
, polkit
|
2020-02-09 01:39:46 +01:00
|
|
|
, gdm
|
|
|
|
, systemd
|
2018-05-06 20:57:45 +02:00
|
|
|
, upower
|
2020-02-09 01:39:46 +01:00
|
|
|
, pam
|
2019-01-09 09:52:58 +01:00
|
|
|
, wrapGAppsHook
|
|
|
|
, writeTextFile
|
|
|
|
, xkeyboard_config
|
2021-04-17 08:58:29 +02:00
|
|
|
, xorg
|
2019-11-06 21:05:22 +01:00
|
|
|
, runCommand
|
2021-06-01 09:59:58 +02:00
|
|
|
, buildEnv
|
2019-01-09 09:52:58 +01:00
|
|
|
}:
|
2018-05-06 20:57:45 +02:00
|
|
|
let
|
|
|
|
pname = "gnome-flashback";
|
2021-03-26 16:18:31 +01:00
|
|
|
version = "3.40.0";
|
2020-02-09 01:39:46 +01:00
|
|
|
|
|
|
|
# From data/sessions/Makefile.am
|
2021-02-21 23:17:27 +01:00
|
|
|
requiredComponentsCommon = enableGnomePanel:
|
|
|
|
[ "gnome-flashback" ]
|
|
|
|
++ lib.optional enableGnomePanel "gnome-panel";
|
2020-02-09 01:39:46 +01:00
|
|
|
requiredComponentsGsd = [
|
|
|
|
"org.gnome.SettingsDaemon.A11ySettings"
|
|
|
|
"org.gnome.SettingsDaemon.Color"
|
|
|
|
"org.gnome.SettingsDaemon.Datetime"
|
|
|
|
"org.gnome.SettingsDaemon.Housekeeping"
|
|
|
|
"org.gnome.SettingsDaemon.Keyboard"
|
|
|
|
"org.gnome.SettingsDaemon.MediaKeys"
|
|
|
|
"org.gnome.SettingsDaemon.Power"
|
|
|
|
"org.gnome.SettingsDaemon.PrintNotifications"
|
|
|
|
"org.gnome.SettingsDaemon.Rfkill"
|
|
|
|
"org.gnome.SettingsDaemon.ScreensaverProxy"
|
|
|
|
"org.gnome.SettingsDaemon.Sharing"
|
|
|
|
"org.gnome.SettingsDaemon.Smartcard"
|
|
|
|
"org.gnome.SettingsDaemon.Sound"
|
|
|
|
"org.gnome.SettingsDaemon.UsbProtection"
|
|
|
|
"org.gnome.SettingsDaemon.Wacom"
|
|
|
|
"org.gnome.SettingsDaemon.XSettings"
|
|
|
|
];
|
2021-02-21 23:17:27 +01:00
|
|
|
requiredComponents = wmName: enableGnomePanel: "RequiredComponents=${lib.concatStringsSep ";" ([ wmName ] ++ requiredComponentsCommon enableGnomePanel ++ requiredComponentsGsd)};";
|
|
|
|
|
2019-01-09 09:52:58 +01:00
|
|
|
gnome-flashback = stdenv.mkDerivation rec {
|
|
|
|
name = "${pname}-${version}";
|
2018-05-06 20:57:45 +02:00
|
|
|
|
2019-01-09 09:52:58 +01:00
|
|
|
src = fetchurl {
|
2021-01-15 14:21:58 +01:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
|
2021-03-26 16:18:31 +01:00
|
|
|
sha256 = "0fxv13m2q9z1q3i9jbggl35cb7jlckbdrfsr5sf030hr1w836gz0";
|
2019-01-09 09:52:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# make .desktop Execs absolute
|
|
|
|
postPatch = ''
|
|
|
|
patch -p0 <<END_PATCH
|
2019-09-02 18:44:48 +02:00
|
|
|
+++ data/applications/gnome-flashback.desktop.in.in
|
2019-01-09 09:52:58 +01:00
|
|
|
@@ -4 +4 @@
|
|
|
|
-Exec=gnome-flashback
|
|
|
|
+Exec=$out/bin/gnome-flashback
|
|
|
|
END_PATCH
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Check that our expected RequiredComponents match the stock session files, but then don't install them.
|
|
|
|
# They can be installed using mkSessionForWm.
|
2021-02-21 23:17:27 +01:00
|
|
|
grep '${requiredComponents "metacity" true}' $out/share/gnome-session/sessions/gnome-flashback-metacity.session || (echo "RequiredComponents have changed, please update gnome-flashback/default.nix."; false)
|
2019-01-09 09:52:58 +01:00
|
|
|
|
|
|
|
rm -r $out/share/gnome-session
|
|
|
|
rm -r $out/share/xsessions
|
|
|
|
rm -r $out/libexec
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
gettext
|
|
|
|
libxml2
|
2021-01-17 03:21:50 +01:00
|
|
|
pkg-config
|
2019-01-09 09:52:58 +01:00
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
gnome-bluetooth
|
|
|
|
gnome-desktop
|
|
|
|
gsettings-desktop-schemas
|
2019-02-13 22:47:50 +01:00
|
|
|
gtk3
|
2019-01-09 09:52:58 +01:00
|
|
|
ibus
|
|
|
|
libcanberra-gtk3
|
|
|
|
libpulseaudio
|
|
|
|
libxkbfile
|
2021-04-17 08:58:29 +02:00
|
|
|
xorg.libXxf86vm
|
2019-01-09 09:52:58 +01:00
|
|
|
polkit
|
2020-02-09 01:39:46 +01:00
|
|
|
gdm
|
|
|
|
gnome-panel
|
|
|
|
systemd
|
2019-01-09 09:52:58 +01:00
|
|
|
upower
|
2020-02-09 01:39:46 +01:00
|
|
|
pam
|
2019-01-09 09:52:58 +01:00
|
|
|
xkeyboard_config
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
2018-05-06 20:57:45 +02:00
|
|
|
|
2019-01-09 09:52:58 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-02-09 01:39:46 +01:00
|
|
|
PKG_CONFIG_LIBGNOME_PANEL_LAYOUTSDIR = "${placeholder "out"}/share/gnome-panel/layouts";
|
|
|
|
PKG_CONFIG_LIBGNOME_PANEL_MODULESDIR = "${placeholder "out"}/lib/gnome-panel/modules";
|
|
|
|
|
2019-01-09 09:52:58 +01:00
|
|
|
passthru = {
|
2021-05-07 23:18:14 +02:00
|
|
|
updateScript = gnome.updateScript {
|
2019-01-09 09:52:58 +01:00
|
|
|
packageName = pname;
|
2021-05-07 23:18:14 +02:00
|
|
|
attrPath = "gnome.${pname}";
|
2021-03-21 00:57:24 +01:00
|
|
|
versionPolicy = "odd-unstable";
|
2019-01-09 09:52:58 +01:00
|
|
|
};
|
|
|
|
|
2021-06-01 09:59:58 +02:00
|
|
|
mkSessionForWm = { wmName, wmLabel, wmCommand, enableGnomePanel, panelModulePackages }:
|
2019-01-09 09:52:58 +01:00
|
|
|
let
|
|
|
|
wmApplication = writeTextFile {
|
|
|
|
name = "gnome-flashback-${wmName}-wm";
|
|
|
|
destination = "/share/applications/${wmName}.desktop";
|
|
|
|
text = ''
|
|
|
|
[Desktop Entry]
|
|
|
|
Type=Application
|
|
|
|
Encoding=UTF-8
|
|
|
|
Name=${wmLabel}
|
|
|
|
Exec=${wmCommand}
|
|
|
|
NoDisplay=true
|
|
|
|
X-GNOME-WMName=${wmLabel}
|
|
|
|
X-GNOME-Autostart-Phase=WindowManager
|
|
|
|
X-GNOME-Provides=windowmanager
|
|
|
|
X-GNOME-Autostart-Notify=false
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2020-08-25 09:33:38 +02:00
|
|
|
gnomeSession = writeTextFile {
|
|
|
|
name = "gnome-flashback-${wmName}-gnome-session";
|
|
|
|
destination = "/share/gnome-session/sessions/gnome-flashback-${wmName}.session";
|
|
|
|
text = ''
|
|
|
|
[GNOME Session]
|
|
|
|
Name=GNOME Flashback (${wmLabel})
|
2021-02-21 23:17:27 +01:00
|
|
|
${requiredComponents wmName enableGnomePanel}
|
2020-08-25 09:33:38 +02:00
|
|
|
'';
|
|
|
|
};
|
2019-01-09 09:52:58 +01:00
|
|
|
|
2021-06-01 09:59:58 +02:00
|
|
|
# gnome-panel will only look for applets in a single directory so symlink them into here.
|
|
|
|
panelModulesEnv = buildEnv {
|
|
|
|
name = "gnome-panel-modules-env";
|
|
|
|
# We always want to find the built-in panel applets.
|
|
|
|
paths = [ gnome-panel gnome-flashback ] ++ panelModulePackages;
|
|
|
|
pathsToLink = [ "/lib/gnome-panel/modules" ];
|
|
|
|
};
|
2019-01-09 09:52:58 +01:00
|
|
|
|
2021-06-01 09:59:58 +02:00
|
|
|
executable = stdenv.mkDerivation {
|
|
|
|
name = "gnome-flashback-${wmName}";
|
|
|
|
nativeBuildInputs = [ glib wrapGAppsHook ];
|
|
|
|
buildInputs = [ gnome-flashback ] ++ lib.optionals enableGnomePanel ([ gnome-panel ] ++ panelModulePackages);
|
|
|
|
|
|
|
|
# We want to use the wrapGAppsHook mechanism to wrap gnome-session
|
|
|
|
# with the environment that gnome-flashback and gnome-panel need to
|
|
|
|
# run, including the configured applet packages. This is only possible
|
|
|
|
# in the fixup phase, so turn everything else off.
|
|
|
|
dontUnpack = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
dontInstall = true;
|
|
|
|
dontWrapGApps = true; # We want to do the wrapping ourselves.
|
|
|
|
|
|
|
|
# gnome-flashback and gnome-panel need to be added to XDG_DATA_DIRS so that their .desktop files can be found by gnome-session.
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapper ${gnome-session}/bin/gnome-session $out \
|
|
|
|
--add-flags "--session=gnome-flashback-${wmName}" \
|
|
|
|
--set-default XDG_CURRENT_DESKTOP 'GNOME-Flashback:GNOME' \
|
|
|
|
--prefix XDG_DATA_DIRS : '${lib.makeSearchPath "share" ([ wmApplication gnomeSession gnome-flashback ] ++ lib.optional enableGnomePanel gnome-panel)}' \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
${lib.optionalString enableGnomePanel "--set NIX_GNOME_PANEL_MODULESDIR '${panelModulesEnv}/lib/gnome-panel/modules'"}
|
|
|
|
'';
|
|
|
|
};
|
2019-01-09 09:52:58 +01:00
|
|
|
|
2020-08-25 09:33:38 +02:00
|
|
|
in
|
|
|
|
writeTextFile
|
|
|
|
{
|
|
|
|
name = "gnome-flashback-${wmName}-xsession";
|
|
|
|
destination = "/share/xsessions/gnome-flashback-${wmName}.desktop";
|
|
|
|
text = ''
|
|
|
|
[Desktop Entry]
|
|
|
|
Name=GNOME Flashback (${wmLabel})
|
|
|
|
Comment=This session logs you into GNOME Flashback with ${wmLabel}
|
2021-06-01 09:59:58 +02:00
|
|
|
Exec=${executable}
|
2020-08-25 09:33:38 +02:00
|
|
|
TryExec=${wmCommand}
|
|
|
|
Type=Application
|
|
|
|
DesktopNames=GNOME-Flashback;GNOME;
|
|
|
|
'';
|
|
|
|
} // {
|
|
|
|
providedSessions = [ "gnome-flashback-${wmName}" ];
|
|
|
|
};
|
2019-11-06 21:05:22 +01:00
|
|
|
|
2021-02-21 23:17:27 +01:00
|
|
|
mkSystemdTargetForWm = { wmName, wmLabel, wmCommand, enableGnomePanel }:
|
|
|
|
runCommand "gnome-flashback-${wmName}.target" {} ''
|
2019-11-06 21:05:22 +01:00
|
|
|
mkdir -p $out/lib/systemd/user
|
2021-02-21 23:17:27 +01:00
|
|
|
cp -r "${gnome-flashback}/lib/systemd/user/gnome-session@gnome-flashback-metacity.target.d" \
|
|
|
|
"$out/lib/systemd/user/gnome-session@gnome-flashback-${wmName}.target.d"
|
2019-11-06 21:05:22 +01:00
|
|
|
'';
|
2018-05-06 20:57:45 +02:00
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-01-09 09:52:58 +01:00
|
|
|
description = "GNOME 2.x-like session for GNOME 3";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://wiki.gnome.org/Projects/GnomeFlashback";
|
2019-01-09 09:52:58 +01:00
|
|
|
license = licenses.gpl2;
|
2020-04-01 14:40:51 +02:00
|
|
|
maintainers = teams.gnome.members;
|
2019-01-09 09:52:58 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2018-05-06 20:57:45 +02:00
|
|
|
};
|
2020-08-25 09:33:38 +02:00
|
|
|
in
|
|
|
|
gnome-flashback
|