We have already packaged GNOME Flashback in #44689, but, we still need a NixOS module to be actually able to run it.
Thanks to upstream sessions, it is much easier now: see https://github.com/jtojnar/nixpkgs/commits/flashback. Though, we might want to allow enabling Flashback independently from gnome3 module. Additionally, the upstream session files, unlike the original packaging effort, do not allow to be easily combined with other window managers like XMonad.
There are also some fixes needed from https://github.com/NixOS/nixpkgs/pull/44497
Hi, I've managed to get Flashback to work with XMonad. It should also work with the default metacity/compiz but I haven't tried it yet. https://gist.github.com/chpatrick/f7e8c30026634d6344924c87c87a08d6
What do you think is the best way to integrate this?
The key thing was to set XDG_DATA_DIRS in the executable so that gnome-flashback, gnome-panel and the window manager are available. For some strange reason, gnome-flashback needs to be added twice like this ${gnome3.gnome-flashback}/share:${gnome3.gnome-flashback}/share/gsettings-schemas/gnome-flashback-3.28.0 otherwise its gsettings schemas will not be found (according to strace). Do you know why this might be?
For some strange reason,
gnome-flashbackneeds to be added twice like this${gnome3.gnome-flashback}/share:${gnome3.gnome-flashback}/share/gsettings-schemas/gnome-flashback-3.28.0otherwise its gsettings schemas will not be found (according to strace). Do you know why this might be?
Yes, this is normal. The schemas are looked up in $XDG_DATA_DIRS/glib-2.0/schemas and we move that directory to share/gsettings-schemas/$name to avoid conflicts of gschemas.compiled. Normally, wrapGAppsHook will take care of this.
As for the expression:
buildDepends
Those are not necessary, they are not ran during build.
XDG_DATA_DIRS
Yeah, wrapGAppsHook to https://github.com/NixOS/nixpkgs/blob/e012ec5b1480f7a76a1509e06ced9c53010b30d9/pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix#L57 will probably do it. Maybe it will even allow to get rid of the rest of the XDG_DATA_DIRS setting in libexec/gnome-flashback-xmonad.
--disable-acceleration-check
Maybe add a comment why this is necessary.
--debug
should not be necessary, services.xserver.desktopManager.gnome3.debug option should enable it.
Otherwise it looks good to me and should be fine for a NixOS module.
OK, I added wrapGAppsHook to the gist. Do you have any thoughts as to how to generalize this to different window managers? Also, should the derivation take the session files from gnome-flashback and splice in the given window manager, or should we copy paste them into the derivation?
OK, I added wrapGAppsHook to the gist
This will work too, though I was thinking about adding it directly to gnome-flashback package.
Do you have any thoughts as to how to generalize this to different window managers?
You can always parametrize it like https://gist.github.com/jtojnar/1414b2fe9bbfab6253719e985bf2d3a1 but as you noticed, the desktop files are not very elegant. Maybe it will get better when gnome-session switches to systemd services.
Also, should the derivation take the session files from gnome-flashback and splice in the given window manager, or should we copy paste them into the derivation?
Both have some merit, do not really have a preference.
We need to take into account that panel applets are not picked up from XDG_DATA_DIRS but from GNOME_PANEL_APPLETS_DIR environment variable (source). We need to do something similar to what MATE is doing.
@jtojnar That is not correct! GNOME_PANEL_APPLETS_DIR only allows to overwrite location and I would say you should not depend on that environment variable...
The real directory is PANEL_APPLETS_DIR:
https://gitlab.gnome.org/GNOME/gnome-panel/blob/b25f16c6077f383a2876512d280f20be10d5ac9a/gnome-panel/libpanel-applet-private/Makefile.am#L10
https://gitlab.gnome.org/GNOME/gnome-panel/blob/b25f16c6077f383a2876512d280f20be10d5ac9a/configure.ac#L242
https://gitlab.gnome.org/GNOME/gnome-panel/blob/b25f16c6077f383a2876512d280f20be10d5ac9a/configure.ac#L243
https://gitlab.gnome.org/GNOME/gnome-panel/blob/b25f16c6077f383a2876512d280f20be10d5ac9a/libpanel-applet/libpanel-applet.pc.in#L8
And there are new library that at some point will replace old library!:
https://gitlab.gnome.org/GNOME/gnome-panel/blob/b25f16c6077f383a2876512d280f20be10d5ac9a/gnome-panel/libpanel-applet-private/Makefile.am#L8
https://gitlab.gnome.org/GNOME/gnome-panel/blob/b25f16c6077f383a2876512d280f20be10d5ac9a/gnome-panel/libpanel-applet-private/gp-applet-manager.c#L114
The real directory is
PANEL_APPLETS_DIR:
Yes, I am aware of that. Unfortunately, we cannot use that, since each package on Nix is installed into its own immutable prefix, so we would not be able to add gnome-applets or other packages once gnome-panel was build.
The only way around it is to patch the program to rely on XDG_DATA_DIRS or other environment variable.
I believe this is fixed.
I believe the missing parts are installation of panel applets and removing gnome-shell from gnome-session closure.
I believe the missing parts are installation of panel applets and removing gnome-shell from gnome-session closure.
Could you open issues for those two improvements?
Most helpful comment
Done