Skip to content

Commit de81290

Browse files
kaynetikgithub-actions[bot]
authored andcommitted
podman-desktop: derive .desktop entry from upstream .flatpak.desktop
Install the upstream .flatpak.desktop directly instead of hand-maintaining a makeDesktopItem, rewriting only the launcher command and icon name and dropping the X-Flatpak key. This keeps Categories and Keywords aligned with upstream and prevents them from regressing. The --replace-fail patterns fail the build if upstream renames those lines. Signed-off-by: kaynetik <aleksandar@nesovic.dev> (cherry picked from commit 7a77089)
1 parent a8cce42 commit de81290

1 file changed

Lines changed: 7 additions & 19 deletions

File tree

pkgs/by-name/po/podman-desktop/package.nix

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
stdenv,
44
fetchFromGitHub,
55
makeBinaryWrapper,
6-
copyDesktopItems,
76
electron_41,
87
nodejs-slim_24,
98
pnpm_10,
109
fetchPnpmDeps,
1110
pnpmConfigHook,
12-
makeDesktopItem,
1311
darwin,
1412
nix-update-script,
1513
_experimental-update-script-combinators,
@@ -96,9 +94,6 @@ stdenv.mkDerivation (finalAttrs: {
9694
pnpm
9795
pnpmConfigHook
9896
]
99-
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
100-
copyDesktopItems
101-
]
10297
++ lib.optionals stdenv.hostPlatform.isDarwin [
10398
darwin.autoSignDarwinBinariesHook
10499
];
@@ -147,6 +142,13 @@ stdenv.mkDerivation (finalAttrs: {
147142
148143
install -Dm644 buildResources/icon.svg "$out/share/icons/hicolor/scalable/apps/podman-desktop.svg"
149144
145+
# Derive the .desktop entry from upstream to keep it aligned and avoid regressions.
146+
install -Dm644 .flatpak.desktop "$out/share/applications/podman-desktop.desktop"
147+
substituteInPlace "$out/share/applications/podman-desktop.desktop" \
148+
--replace-fail 'Exec=run.sh %U' 'Exec=podman-desktop %U' \
149+
--replace-fail 'Icon=io.podman_desktop.PodmanDesktop' 'Icon=podman-desktop'
150+
sed -i '/^X-Flatpak=/d' "$out/share/applications/podman-desktop.desktop"
151+
150152
makeWrapper '${electron}/bin/electron' "$out/bin/podman-desktop" \
151153
--add-flags "$out/share/lib/podman-desktop/resources/app.asar" \
152154
--set XDG_SESSION_TYPE 'x11' \
@@ -159,20 +161,6 @@ stdenv.mkDerivation (finalAttrs: {
159161
''
160162
);
161163

162-
# see: https://github.com/podman-desktop/podman-desktop/blob/main/.flatpak.desktop
163-
desktopItems = [
164-
(makeDesktopItem {
165-
name = "podman-desktop";
166-
exec = "podman-desktop %U";
167-
icon = "podman-desktop";
168-
desktopName = appName;
169-
genericName = "Desktop client for podman";
170-
comment = finalAttrs.meta.description;
171-
categories = [ "Utility" ];
172-
startupWMClass = appName;
173-
})
174-
];
175-
176164
meta = {
177165
description = "Graphical tool for developing on containers and Kubernetes";
178166
homepage = "https://podman-desktop.io";

0 commit comments

Comments
 (0)