tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
podman-desktop: init at 0.12.0
Nick Cao
2 years ago
55024cd3
3b0d74bc
+148
4 changed files
expand all
collapse all
unified
split
pkgs
applications
virtualization
podman-desktop
default.nix
patches
extension-no-download-podman.patch
fix-yarn-lock-deterministic.patch
top-level
all-packages.nix
+120
pkgs/applications/virtualization/podman-desktop/default.nix
···
1
1
+
{ lib
2
2
+
, stdenv
3
3
+
, fetchFromGitHub
4
4
+
, fetchYarnDeps
5
5
+
, yarn
6
6
+
, fixup_yarn_lock
7
7
+
, nodejs
8
8
+
, makeWrapper
9
9
+
, copyDesktopItems
10
10
+
, desktopToDarwinBundle
11
11
+
, electron
12
12
+
, makeDesktopItem
13
13
+
}:
14
14
+
15
15
+
stdenv.mkDerivation (self: {
16
16
+
pname = "podman-desktop";
17
17
+
version = "0.12.0";
18
18
+
19
19
+
src = fetchFromGitHub {
20
20
+
owner = "containers";
21
21
+
repo = "podman-desktop";
22
22
+
rev = "v${self.version}";
23
23
+
sha256 = "sha256-gEjcI+bfETYZB/pHDXRcNxNVDsbwuqQL1E22fMkIJHI=";
24
24
+
};
25
25
+
26
26
+
offlineCache = fetchYarnDeps {
27
27
+
yarnLock = "${self.src}/yarn.lock";
28
28
+
sha256 = "sha256-x0hqNxi6r1i3vBe1tJQl+Oht2St9VIH3Eq27MZLkojA=";
29
29
+
};
30
30
+
31
31
+
patches = [
32
32
+
# podman should be installed with nix; disable auto-installation
33
33
+
./patches/extension-no-download-podman.patch
34
34
+
./patches/fix-yarn-lock-deterministic.patch
35
35
+
];
36
36
+
37
37
+
postPatch = ''
38
38
+
for file in packages/main/src/tray-animate-icon.ts extensions/podman/src/util.ts packages/main/src/plugin/certificates.ts; do
39
39
+
substituteInPlace "$file" \
40
40
+
--replace 'process.resourcesPath' "'$out/share/lib/podman-desktop/resources'" \
41
41
+
--replace '(process as any).resourcesPath' "'$out/share/lib/podman-desktop/resources'"
42
42
+
done
43
43
+
'';
44
44
+
45
45
+
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
46
46
+
47
47
+
nativeBuildInputs = [
48
48
+
yarn
49
49
+
fixup_yarn_lock
50
50
+
nodejs
51
51
+
makeWrapper
52
52
+
copyDesktopItems
53
53
+
]
54
54
+
++ lib.optionals stdenv.isDarwin [
55
55
+
desktopToDarwinBundle
56
56
+
];
57
57
+
58
58
+
configurePhase = ''
59
59
+
runHook preConfigure
60
60
+
61
61
+
export HOME="$TMPDIR"
62
62
+
yarn config --offline set yarn-offline-mirror "$offlineCache"
63
63
+
fixup_yarn_lock yarn.lock
64
64
+
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
65
65
+
patchShebangs node_modules/
66
66
+
67
67
+
runHook postConfigure
68
68
+
'';
69
69
+
70
70
+
buildPhase = ''
71
71
+
runHook preBuild
72
72
+
73
73
+
yarn --offline run build
74
74
+
yarn --offline run electron-builder --dir \
75
75
+
--config .electron-builder.config.cjs \
76
76
+
-c.electronDist=${electron}/lib/electron \
77
77
+
-c.electronVersion=${electron.version}
78
78
+
79
79
+
runHook postBuild
80
80
+
'';
81
81
+
82
82
+
installPhase = ''
83
83
+
runHook preInstall
84
84
+
85
85
+
mkdir -p "$out/share/lib/podman-desktop"
86
86
+
cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/podman-desktop"
87
87
+
88
88
+
install -Dm644 buildResources/icon.svg "$out/share/icons/hicolor/scalable/apps/podman-desktop.svg"
89
89
+
90
90
+
makeWrapper '${electron}/bin/electron' "$out/bin/podman-desktop" \
91
91
+
--add-flags "$out/share/lib/podman-desktop/resources/app.asar" \
92
92
+
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
93
93
+
--inherit-argv0
94
94
+
95
95
+
runHook postInstall
96
96
+
'';
97
97
+
98
98
+
# see: https://github.com/containers/podman-desktop/blob/main/.flatpak.desktop
99
99
+
desktopItems = [
100
100
+
(makeDesktopItem {
101
101
+
name = "podman-desktop";
102
102
+
exec = "podman-desktop %U";
103
103
+
icon = "podman-desktop";
104
104
+
desktopName = "Podman Desktop";
105
105
+
genericName = "Desktop client for podman";
106
106
+
comment = self.meta.description;
107
107
+
categories = [ "Utility" ];
108
108
+
startupWMClass = "Podman Desktop";
109
109
+
})
110
110
+
];
111
111
+
112
112
+
meta = with lib; {
113
113
+
description = "A graphical tool for developing on containers and Kubernetes";
114
114
+
homepage = "https://podman-desktop.io";
115
115
+
changelog = "https://github.com/containers/podman-desktop/releases/tag/v${self.version}";
116
116
+
license = licenses.asl20;
117
117
+
maintainers = with maintainers; [ panda2134 ];
118
118
+
inherit (electron.meta) platforms;
119
119
+
};
120
120
+
})
+13
pkgs/applications/virtualization/podman-desktop/patches/extension-no-download-podman.patch
···
1
1
+
diff --git a/extensions/podman/package.json b/extensions/podman/package.json
2
2
+
index 5f86bbe9..92c0ef3b 100644
3
3
+
--- a/extensions/podman/package.json
4
4
+
+++ b/extensions/podman/package.json
5
5
+
@@ -86,7 +86,7 @@
6
6
+
}
7
7
+
},
8
8
+
"scripts": {
9
9
+
- "build": "rollup --bundleConfigAsCjs --config rollup.config.js --compact --environment BUILD:production && npx ts-node ./scripts/download.ts && node ./scripts/build.js",
10
10
+
+ "build": "rollup --bundleConfigAsCjs --config rollup.config.js --compact --environment BUILD:production && node ./scripts/build.js",
11
11
+
"watch": "rollup --bundleConfigAsCjs --config rollup.config.js -w",
12
12
+
"test": "vitest run --passWithNoTests"
13
13
+
},
+13
pkgs/applications/virtualization/podman-desktop/patches/fix-yarn-lock-deterministic.patch
···
1
1
+
diff --git a/yarn.lock b/yarn.lock
2
2
+
index ae340d04..5acc3fed 100644
3
3
+
--- a/yarn.lock
4
4
+
+++ b/yarn.lock
5
5
+
@@ -12753,7 +12753,7 @@ ws@^7.3.1:
6
6
+
resolved "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz"
7
7
+
integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==
8
8
+
9
9
+
-ws@^8.11.0, ws@^8.4.2:
10
10
+
+ws@^8.11.0, ws@^8.12.0, ws@^8.4.2:
11
11
+
version "8.12.0"
12
12
+
resolved "https://registry.yarnpkg.com/ws/-/ws-8.12.0.tgz#485074cc392689da78e1828a9ff23585e06cddd8"
13
13
+
integrity sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==
+2
pkgs/top-level/all-packages.nix
···
11174
11174
11175
11175
podman-tui = callPackage ../applications/virtualization/podman-tui { };
11176
11176
11177
11177
+
podman-desktop = callPackage ../applications/virtualization/podman-desktop {};
11178
11178
+
11177
11179
pods = callPackage ../applications/virtualization/pods { };
11178
11180
11179
11181
pod2mdoc = callPackage ../tools/misc/pod2mdoc { };