Nixpkgs: Add GNOME Flashback support

Created on 28 Sep 2018  路  13Comments  路  Source: NixOS/nixpkgs

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

GNOME nixos module (new)

Most helpful comment

All 13 comments

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-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?

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.

53695

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.

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rzetterberg picture rzetterberg  路  3Comments

langston-barrett picture langston-barrett  路  3Comments

sid-kap picture sid-kap  路  3Comments

matthiasbeyer picture matthiasbeyer  路  3Comments

ghost picture ghost  路  3Comments