nixpkgs/pkgs/applications/networking/cluster/lens/default.nix
Alvar Penning deabb57e15 lens: 4.2.4 -> 5.1.3
Lens does no longer ships its AppImages via GitHub. The new URL also
contains some more detailed build tag, indicating a date.
2021-08-26 16:38:14 +02:00

42 lines
1.2 KiB
Nix

{ lib, fetchurl, appimageTools }:
let
pname = "lens";
version = "5.1.3";
build = "${version}-latest.20210722.1";
name = "${pname}-${version}";
src = fetchurl {
url = "https://api.k8slens.dev/binaries/Lens-${build}.x86_64.AppImage";
sha256 = "1iwwyqpn1x1m8n22f99snlhcbcr65i4przx697hlbpmnm40dw7q9";
name="${pname}.AppImage";
};
appimageContents = appimageTools.extractType2 {
inherit name src;
};
in appimageTools.wrapType2 {
inherit name src;
extraInstallCommands =
''
mv $out/bin/${name} $out/bin/${pname}
install -m 444 -D ${appimageContents}/lens.desktop $out/share/applications/${pname}.desktop
install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/lens.png \
$out/share/icons/hicolor/512x512/apps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Icon=lens' 'Icon=${pname}' \
--replace 'Exec=AppRun' 'Exec=${pname}'
'';
meta = with lib; {
description = "The Kubernetes IDE";
homepage = "https://k8slens.dev/";
license = licenses.mit;
maintainers = with maintainers; [ dbirks ];
platforms = [ "x86_64-linux" ];
};
}