10 , autoSignDarwinBinariesHook
14 stdenv.mkDerivation (finalAttrs: {
15 pname = "podman-desktop";
18 passthru.updateScript = nix-update-script { };
20 src = fetchFromGitHub {
22 repo = "podman-desktop";
23 rev = "v${finalAttrs.version}";
24 sha256 = "sha256-07lf9jy22JUT+Vc5y9Tu1nkWaXU5RTdu3GibcvQsSs8=";
27 pnpmDeps = pnpm.fetchDeps {
28 inherit (finalAttrs) pname version src;
29 hash = "sha256-LPsNRd1c/cQeyBn3LZKnKeAsZ981sOkLYTnXIZL82LA=";
33 # podman should be installed with nix; disable auto-installation
34 ./patches/extension-no-download-podman.patch
38 for file in packages/main/src/tray-animate-icon.ts packages/main/src/plugin/certificates.ts; do
39 substituteInPlace "$file" \
40 --replace-fail 'process.resourcesPath' "'$out/share/lib/podman-desktop/resources'"
42 substituteInPlace "extensions/podman/packages/extension/src/util.ts" \
43 --replace-fail '(process as any).resourcesPath' "'$out/share/lib/podman-desktop/resources'"
46 ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
49 makeWrapper nodejs pnpm.configHook
50 ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
52 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
53 autoSignDarwinBinariesHook
59 cp -r ${electron.dist} electron-dist
60 chmod -R u+w electron-dist
63 ./node_modules/.bin/electron-builder \
65 --config .electron-builder.config.cjs \
66 -c.electronDist=electron-dist \
67 -c.electronVersion=${electron.version}
75 mkdir -p "$out/share/lib/podman-desktop"
76 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
77 mkdir -p $out/{Applications,bin}
78 mv dist/mac*/Podman\ Desktop.app $out/Applications
79 ln -s $out/Applications/Podman\ Desktop.app/Contents/Resources "$out/share/lib/podman-desktop/resources"
81 makeWrapper "$out/Applications/Podman Desktop.app/Contents/MacOS/Podman Desktop" $out/bin/podman-desktop
82 '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
83 cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/podman-desktop"
85 install -Dm644 buildResources/icon.svg "$out/share/icons/hicolor/scalable/apps/podman-desktop.svg"
87 makeWrapper '${electron}/bin/electron' "$out/bin/podman-desktop" \
88 --add-flags "$out/share/lib/podman-desktop/resources/app.asar" \
89 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
96 # see: https://github.com/containers/podman-desktop/blob/main/.flatpak.desktop
99 name = "podman-desktop";
100 exec = "podman-desktop %U";
101 icon = "podman-desktop";
102 desktopName = "Podman Desktop";
103 genericName = "Desktop client for podman";
104 comment = finalAttrs.meta.description;
105 categories = [ "Utility" ];
106 startupWMClass = "Podman Desktop";
111 description = "A graphical tool for developing on containers and Kubernetes";
112 homepage = "https://podman-desktop.io";
113 changelog = "https://github.com/containers/podman-desktop/releases/tag/v${finalAttrs.version}";
114 license = lib.licenses.asl20;
115 maintainers = with lib.maintainers; [ booxter panda2134 ];
116 inherit (electron.meta) platforms;
117 mainProgram = "podman-desktop";