diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/desktops/gnome/default.nix | 2 | ||||
-rw-r--r-- | pkgs/desktops/gnome/misc/gnome-flashback/default.nix | 26 | ||||
-rw-r--r-- | pkgs/desktops/gnome/misc/gnome-panel/wrapper.nix | 66 |
3 files changed, 74 insertions, 20 deletions
diff --git a/pkgs/desktops/gnome/default.nix b/pkgs/desktops/gnome/default.nix index f9c782117c79f..d356094942f32 100644 --- a/pkgs/desktops/gnome/default.nix +++ b/pkgs/desktops/gnome/default.nix @@ -240,6 +240,8 @@ lib.makeScope pkgs.newScope (self: with self; { gnome-panel = callPackage ./misc/gnome-panel { }; + gnome-panel-with-modules = callPackage ./misc/gnome-panel/wrapper.nix { }; + gnome-tweaks = callPackage ./misc/gnome-tweaks { }; gpaste = callPackage ./misc/gpaste { }; diff --git a/pkgs/desktops/gnome/misc/gnome-flashback/default.nix b/pkgs/desktops/gnome/misc/gnome-flashback/default.nix index cfe0903cce7b0..fd2abf1b51fc9 100644 --- a/pkgs/desktops/gnome/misc/gnome-flashback/default.nix +++ b/pkgs/desktops/gnome/misc/gnome-flashback/default.nix @@ -23,6 +23,7 @@ , upower , pam , wrapGAppsHook +, makeWrapper , writeTextFile , xkeyboard_config , xorg @@ -127,7 +128,7 @@ let versionPolicy = "odd-unstable"; }; - mkSessionForWm = { wmName, wmLabel, wmCommand, enableGnomePanel, panelModulePackages }: + mkSessionForWm = { wmName, wmLabel, wmCommand, enableGnomePanel }: let wmApplication = writeTextFile { name = "gnome-flashback-${wmName}-wm"; @@ -156,28 +157,15 @@ let ''; }; - # 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" ]; - }; - 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. + nativeBuildInputs = [ makeWrapper ]; + 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. # We need to pass the --builtin flag so that gnome-session invokes gnome-session-binary instead of systemd. @@ -186,9 +174,7 @@ let makeWrapper ${gnome-session}/bin/gnome-session $out \ --add-flags "--session=gnome-flashback-${wmName} --builtin" \ --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'"} + --prefix XDG_DATA_DIRS : '${lib.makeSearchPath "share" [ wmApplication gnomeSession gnome-flashback ]}' ''; }; @@ -211,7 +197,7 @@ let }; mkSystemdTargetForWm = { wmName, wmLabel, wmCommand, enableGnomePanel }: - runCommand "gnome-flashback-${wmName}.target" {} '' + runCommand "gnome-flashback-${wmName}.target" { } '' mkdir -p $out/lib/systemd/user 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" diff --git a/pkgs/desktops/gnome/misc/gnome-panel/wrapper.nix b/pkgs/desktops/gnome/misc/gnome-panel/wrapper.nix new file mode 100644 index 0000000000000..6afee1051af47 --- /dev/null +++ b/pkgs/desktops/gnome/misc/gnome-panel/wrapper.nix @@ -0,0 +1,66 @@ +{ stdenv +, lib +, buildEnv +, gnome-panel +, gnome-flashback +, xorg +, glib +, wrapGAppsHook +, panelModulePackages ? [ ] +}: + +let + # We always want to find the built-in panel applets. + selectedPanelModulePackages = [ gnome-panel gnome-flashback ] ++ panelModulePackages; + + panelModulesEnv = buildEnv { + name = "gnome-panel-modules-env"; + paths = selectedPanelModulePackages; + pathsToLink = [ "/lib/gnome-panel/modules" ]; + }; +in +stdenv.mkDerivation { + pname = "${gnome-panel.pname}-with-modules"; + inherit (gnome-panel) version; + + nativeBuildInputs = [ + glib + wrapGAppsHook + ]; + + buildInputs = selectedPanelModulePackages ++ + lib.forEach selectedPanelModulePackages (x: x.buildInputs or [ ]); + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + preferLocalBuild = true; + allowSubstitutes = false; + + installPhase = '' + runHook preInstall + + mkdir -p $out + ${xorg.lndir}/bin/lndir -silent ${gnome-panel} $out + + rm -r $out/lib/gnome-panel/modules + ${xorg.lndir}/bin/lndir -silent ${panelModulesEnv} $out + + rm $out/share/applications/gnome-panel.desktop + + substitute ${gnome-panel}/share/applications/gnome-panel.desktop \ + $out/share/applications/gnome-panel.desktop --replace \ + "Exec=${gnome-panel}/bin/gnome-panel" "Exec=$out/bin/gnome-panel" + + runHook postInstall + ''; + + preFixup = '' + gappsWrapperArgs+=( + --set NIX_GNOME_PANEL_MODULESDIR "$out/lib/gnome-panel/modules" + ) + ''; + + meta = gnome-panel.meta // { outputsToInstall = [ "out" ]; }; +} |