nixpkgs/pkgs/applications/networking/cluster/openlens/default.nix
Peder Bergebakken Sundt 985aa8174d treewide: unbreak appimageTools.wrapType2 builds
`appimageTools.wrapType2` no longer creates a binary `$out/bin/${name}` if `pname` and `version` is provided.
Derivations that have worked around this behavior with a `mv $out/bin/{${name},${pname}}` broke as a result.
This should fix most instances.

contex: #271071
2024-04-24 15:26:52 +02:00

40 lines
1.2 KiB
Nix

{ lib, fetchurl, appimageTools }:
let
pname = "openlens";
version = "6.5.2-366";
src = fetchurl {
url = "https://github.com/MuhammedKalkan/OpenLens/releases/download/v${version}/OpenLens-${version}.x86_64.AppImage";
sha256 = "sha256-ZAltAS/U/xh4kCT7vQ+NHAzWV7z0uE5GMQICHKSdj8k=";
};
appimageContents = appimageTools.extractType2 {
inherit pname version src;
};
in
appimageTools.wrapType2 {
inherit pname version src;
unshareIpc = false;
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/open-lens.desktop $out/share/applications/${pname}.desktop
install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/open-lens.png \
$out/share/icons/hicolor/512x512/apps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Icon=open-lens' 'Icon=${pname}' \
--replace 'Exec=AppRun' 'Exec=${pname}'
'';
meta = with lib; {
description = "The Kubernetes IDE";
homepage = "https://github.com/MuhammedKalkan/OpenLens";
license = licenses.mit;
maintainers = with maintainers; [ benwbooth sebtm ];
mainProgram = "openlens";
platforms = [ "x86_64-linux" ];
};
}