Merge pull request #222727 from panda2134/podman-desktop
podman-desktop: init at 0.12.0
This commit is contained in:
commit
b97ea5900b
5 changed files with 154 additions and 0 deletions
|
@ -11545,6 +11545,12 @@
|
|||
githubId = 686076;
|
||||
name = "Vitalii Voloshyn";
|
||||
};
|
||||
panda2134 = {
|
||||
email = "me+nixpkgs@panda2134.site";
|
||||
github = "panda2134";
|
||||
githubId = 7239200;
|
||||
name = "panda2134";
|
||||
};
|
||||
pandaman = {
|
||||
email = "kointosudesuyo@infoseek.jp";
|
||||
github = "pandaman64";
|
||||
|
|
120
pkgs/applications/virtualization/podman-desktop/default.nix
Normal file
120
pkgs/applications/virtualization/podman-desktop/default.nix
Normal file
|
@ -0,0 +1,120 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchYarnDeps
|
||||
, yarn
|
||||
, fixup_yarn_lock
|
||||
, nodejs
|
||||
, makeWrapper
|
||||
, copyDesktopItems
|
||||
, desktopToDarwinBundle
|
||||
, electron
|
||||
, makeDesktopItem
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (self: {
|
||||
pname = "podman-desktop";
|
||||
version = "0.12.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "containers";
|
||||
repo = "podman-desktop";
|
||||
rev = "v${self.version}";
|
||||
sha256 = "sha256-gEjcI+bfETYZB/pHDXRcNxNVDsbwuqQL1E22fMkIJHI=";
|
||||
};
|
||||
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = "${self.src}/yarn.lock";
|
||||
sha256 = "sha256-x0hqNxi6r1i3vBe1tJQl+Oht2St9VIH3Eq27MZLkojA=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# podman should be installed with nix; disable auto-installation
|
||||
./patches/extension-no-download-podman.patch
|
||||
./patches/fix-yarn-lock-deterministic.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
for file in packages/main/src/tray-animate-icon.ts extensions/podman/src/util.ts packages/main/src/plugin/certificates.ts; do
|
||||
substituteInPlace "$file" \
|
||||
--replace 'process.resourcesPath' "'$out/share/lib/podman-desktop/resources'" \
|
||||
--replace '(process as any).resourcesPath' "'$out/share/lib/podman-desktop/resources'"
|
||||
done
|
||||
'';
|
||||
|
||||
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
||||
|
||||
nativeBuildInputs = [
|
||||
yarn
|
||||
fixup_yarn_lock
|
||||
nodejs
|
||||
makeWrapper
|
||||
copyDesktopItems
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin [
|
||||
desktopToDarwinBundle
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
export HOME="$TMPDIR"
|
||||
yarn config --offline set yarn-offline-mirror "$offlineCache"
|
||||
fixup_yarn_lock yarn.lock
|
||||
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
|
||||
patchShebangs node_modules/
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
yarn --offline run build
|
||||
yarn --offline run electron-builder --dir \
|
||||
--config .electron-builder.config.cjs \
|
||||
-c.electronDist=${electron}/lib/electron \
|
||||
-c.electronVersion=${electron.version}
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p "$out/share/lib/podman-desktop"
|
||||
cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/podman-desktop"
|
||||
|
||||
install -Dm644 buildResources/icon.svg "$out/share/icons/hicolor/scalable/apps/podman-desktop.svg"
|
||||
|
||||
makeWrapper '${electron}/bin/electron' "$out/bin/podman-desktop" \
|
||||
--add-flags "$out/share/lib/podman-desktop/resources/app.asar" \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
|
||||
--inherit-argv0
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
# see: https://github.com/containers/podman-desktop/blob/main/.flatpak.desktop
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = "podman-desktop";
|
||||
exec = "podman-desktop %U";
|
||||
icon = "podman-desktop";
|
||||
desktopName = "Podman Desktop";
|
||||
genericName = "Desktop client for podman";
|
||||
comment = self.meta.description;
|
||||
categories = [ "Utility" ];
|
||||
startupWMClass = "Podman Desktop";
|
||||
})
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A graphical tool for developing on containers and Kubernetes";
|
||||
homepage = "https://podman-desktop.io";
|
||||
changelog = "https://github.com/containers/podman-desktop/releases/tag/v${self.version}";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ panda2134 ];
|
||||
inherit (electron.meta) platforms;
|
||||
};
|
||||
})
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/extensions/podman/package.json b/extensions/podman/package.json
|
||||
index 5f86bbe9..92c0ef3b 100644
|
||||
--- a/extensions/podman/package.json
|
||||
+++ b/extensions/podman/package.json
|
||||
@@ -86,7 +86,7 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
- "build": "rollup --bundleConfigAsCjs --config rollup.config.js --compact --environment BUILD:production && npx ts-node ./scripts/download.ts && node ./scripts/build.js",
|
||||
+ "build": "rollup --bundleConfigAsCjs --config rollup.config.js --compact --environment BUILD:production && node ./scripts/build.js",
|
||||
"watch": "rollup --bundleConfigAsCjs --config rollup.config.js -w",
|
||||
"test": "vitest run --passWithNoTests"
|
||||
},
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/yarn.lock b/yarn.lock
|
||||
index ae340d04..5acc3fed 100644
|
||||
--- a/yarn.lock
|
||||
+++ b/yarn.lock
|
||||
@@ -12753,7 +12753,7 @@ ws@^7.3.1:
|
||||
resolved "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz"
|
||||
integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==
|
||||
|
||||
-ws@^8.11.0, ws@^8.4.2:
|
||||
+ws@^8.11.0, ws@^8.12.0, ws@^8.4.2:
|
||||
version "8.12.0"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.12.0.tgz#485074cc392689da78e1828a9ff23585e06cddd8"
|
||||
integrity sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==
|
|
@ -11184,6 +11184,8 @@ with pkgs;
|
|||
|
||||
podman-tui = callPackage ../applications/virtualization/podman-tui { };
|
||||
|
||||
podman-desktop = callPackage ../applications/virtualization/podman-desktop {};
|
||||
|
||||
pods = callPackage ../applications/virtualization/pods { };
|
||||
|
||||
pod2mdoc = callPackage ../tools/misc/pod2mdoc { };
|
||||
|
|
Loading…
Reference in a new issue