Change:
Panel applets are being picked up from environment variable in and a completely hardcoded path in . First, we will need to patch the latter manager to use an environment variable as well. Second, we will need to do something similar to what . Or better, create  derivation. Originally posted by in
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly: for maintainers and people that previously touched the related code and @ mention them in a comment. on the . on the on .
I'd like to tackle this, do you have any pointers? We need to get it to pick up at least right?

Discussion:
default = []; description = "Other GNOME Flashback sessions to enable."; }; <ins> panelModulePackages = mkOption { default = [ pkgs.gnome.gnome-applets ]; type = types.listOf types.path; description = '' Packages containing modules that should be made available to <literal>gnome-panel</literal> (usually for applets). If you're packaging something to use here, please install the modules in <literal>$out/lib/gnome-panel/modules</literal>. ''; example = literalExample "[ pkgs.gnome.gnome-applets ]"; }; </ins> }; };

(wm: pkgs.gnome.gnome-flashback.mkSessionForWm { inherit (wm) wmName wmLabel wmCommand enableGnomePanel; <ins> inherit (cfg.flashback) panelModulePackages; </ins> } ) flashbackWms;

, pam , wrapGAppsHook , writeTextFile <del> , writeShellScriptBin </del> , xkeyboard_config , xorg , runCommand <ins> , buildEnv </ins> }: let pname = "gnome-flashback";

versionPolicy = "odd-unstable"; }; <del> mkSessionForWm = { wmName, wmLabel, wmCommand, enableGnomePanel }: </del> <ins> mkSessionForWm = { wmName, wmLabel, wmCommand, enableGnomePanel, panelModulePackages }: </ins> let wmApplication = writeTextFile { name = "gnome-flashback-${wmName}-wm";

''; }; <del> executable = writeShellScriptBin "gnome-flashback-${wmName}" '' if [ -z $XDG_CURRENT_DESKTOP ]; then export XDG_CURRENT_DESKTOP="GNOME-Flashback:GNOME" fi export XDG_DATA_DIRS=${wmApplication}/share:${gnomeSession}/share:${gnome-flashback}/share:${gnome-panel}/share:$XDG_DATA_DIRS </del> <ins> # 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" ]; }; </ins> <del> exec ${gnome-session}/bin/gnome-session --session=gnome-flashback-${wmName} "$@" ''; </del> <ins> 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'"} ''; }; </ins> in writeTextFile

[Desktop Entry] Name=GNOME Flashback (${wmLabel}) Comment=This session logs you into GNOME Flashback with ${wmLabel} <del> Exec=${executable}/bin/gnome-flashback-${wmName} </del> <ins> Exec=${executable} </ins> TryExec=${wmCommand} Type=Application DesktopNames=GNOME-Flashback;GNOME;

hash = "sha256-nxNQde3GZs8rnKkd41xnA+KxdxwQp3B0FPtlbCilmzs="; }; <ins> patches = [ # Load modules from path in `NIX_GNOME_PANEL_MODULESDIR` environment variable # instead of gnome-panel’s libdir so that the NixOS module can make gnome-panel # load modules from other packages as well. ./modulesdir-env-var.patch ]; </ins> # make .desktop Exec absolute postPatch = '' patch -p0 <<END_PATCH

<ins> diff --git a/gnome-panel/gp-module-manager.c b/gnome-panel/gp-module-manager.c index 58447fd84..7af99de7d 100644 --- a/gnome-panel/gp-module-manager.c +++ b/gnome-panel/gp-module-manager.c @@ -49,8 +49,16 @@ load_modules (GpModuleManager *self) { GDir *dir; const gchar *name; +  const gchar *modules_dir; -  dir = g_dir_open (MODULESDIR, 0, NULL); +  modules_dir = g_getenv ("NIX_GNOME_PANEL_MODULESDIR"); + +  if (!modules_dir) { +    g_warning ("The NIX_GNOME_PANEL_MODULESDIR environment variable was not set, modules will not be loaded."); +    return; +  } + +  dir = g_dir_open (modules_dir, 0, NULL); if (!dir) return; @@ -63,7 +71,7 @@ load_modules (GpModuleManager *self) if (!g_str_has_suffix (name, ".so")) continue; -      path = g_build_filename (MODULESDIR, name, NULL); +      path = g_build_filename (modules_dir, name, NULL); module = gp_module_new_from_path (path); g_free (path); </ins>