nixpkgs/pkgs/applications/networking/cluster/lens/default.nix

43 lines
1.2 KiB
Nix
Raw Normal View History

2020-10-22 05:24:25 +01:00
{ lib, fetchurl, appimageTools }:
let
pname = "lens";
2021-11-09 16:33:16 +00:00
version = "5.2.6";
build = "${version}-latest.20211104.1";
2020-10-22 05:24:25 +01:00
name = "${pname}-${version}";
src = fetchurl {
url = "https://api.k8slens.dev/binaries/Lens-${build}.x86_64.AppImage";
2021-11-09 16:33:16 +00:00
sha256 = "1lkxzgwrgafraimpnciv89fs6r399275vb73drxlg5z83acacf5z";
2020-10-22 05:24:25 +01:00
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
2020-10-22 05:24:25 +01:00
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Icon=lens' 'Icon=${pname}' \
2020-10-22 05:24:25 +01:00
--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" ];
};
}