summary refs log tree commit diff
path: root/pkgs/desktops/gnome/misc
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/desktops/gnome/misc')
-rw-r--r--pkgs/desktops/gnome/misc/gnome-flashback/default.nix96
-rw-r--r--pkgs/desktops/gnome/misc/gnome-panel/wrapper.nix66
-rw-r--r--pkgs/desktops/gnome/misc/pomodoro/default.nix4
3 files changed, 98 insertions, 68 deletions
diff --git a/pkgs/desktops/gnome/misc/gnome-flashback/default.nix b/pkgs/desktops/gnome/misc/gnome-flashback/default.nix
index cfe0903cce7..ceb7d8d59a3 100644
--- a/pkgs/desktops/gnome/misc/gnome-flashback/default.nix
+++ b/pkgs/desktops/gnome/misc/gnome-flashback/default.nix
@@ -127,72 +127,36 @@ let
         versionPolicy = "odd-unstable";
       };
 
-      mkSessionForWm = { wmName, wmLabel, wmCommand, enableGnomePanel, panelModulePackages }:
-        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
-            '';
-          };
+      mkWmApplication = { wmName, wmLabel, wmCommand }:
+        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
+          '';
+        };
 
-          gnomeSession = writeTextFile {
-            name = "gnome-flashback-${wmName}-gnome-session";
-            destination = "/share/gnome-session/sessions/gnome-flashback-${wmName}.session";
-            text = ''
-              [GNOME Session]
-              Name=GNOME Flashback (${wmLabel})
-              ${requiredComponents wmName enableGnomePanel}
-            '';
-          };
-
-          # 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.
-            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.
-            # If systemd is used, it doesn't use the environment we set up here and so it can't find the .desktop files.
-            preFixup = ''
-              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'"}
-            '';
-          };
+      mkGnomeSession = { wmName, wmLabel, enableGnomePanel }:
+        writeTextFile {
+          name = "gnome-flashback-${wmName}-gnome-session";
+          destination = "/share/gnome-session/sessions/gnome-flashback-${wmName}.session";
+          text = ''
+            [GNOME Session]
+            Name=GNOME Flashback (${wmLabel})
+            ${requiredComponents wmName enableGnomePanel}
+          '';
+        };
 
-        in
+      mkSessionForWm = { wmName, wmLabel, wmCommand }:
         writeTextFile
           {
             name = "gnome-flashback-${wmName}-xsession";
@@ -201,7 +165,7 @@ let
               [Desktop Entry]
               Name=GNOME Flashback (${wmLabel})
               Comment=This session logs you into GNOME Flashback with ${wmLabel}
-              Exec=${executable}
+              Exec=${gnome-session}/bin/gnome-session --session=gnome-flashback-${wmName}
               TryExec=${wmCommand}
               Type=Application
               DesktopNames=GNOME-Flashback;GNOME;
@@ -211,7 +175,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 00000000000..6afee1051af
--- /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" ]; };
+}
diff --git a/pkgs/desktops/gnome/misc/pomodoro/default.nix b/pkgs/desktops/gnome/misc/pomodoro/default.nix
index 4474c3c6a68..3067c5de5fb 100644
--- a/pkgs/desktops/gnome/misc/pomodoro/default.nix
+++ b/pkgs/desktops/gnome/misc/pomodoro/default.nix
@@ -24,13 +24,13 @@
 
 stdenv.mkDerivation rec {
   pname = "gnome-pomodoro";
-  version = "0.23.1";
+  version = "0.24.0";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = version;
-    hash = "sha256-0ZUTRrth5AfzI1E4JsuchbYeFwAbl9/XGBSYQ+AnNvM=";
+    hash = "sha256-Yn0lDCFpc8o25iiPib1n1NEBeodNAdTzRWcnLbXUA5g=";
   };
 
   patches = [