lens: 6.3.0 -> 6.5.2 (#242911)

This commit is contained in:
Diamondy Franc 2023-08-06 01:45:17 +03:00 committed by GitHub
parent 09464624dd
commit 54e6327e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 26 deletions

View File

@ -0,0 +1,22 @@
{ fetchurl }:
let
build = "2023.5.310801-latest";
in
{
pname = "lens-desktop";
version = "6.5.2";
sources = {
x86_64-darwin = fetchurl {
sha256 = "sha256-AGU1kOQEYBAGqWaxftqSNVdPEblPDujKSBjMeaVNx6M=";
url = "https://api.k8slens.dev/binaries/Lens-${build}.dmg";
};
aarch64-darwin = fetchurl {
sha256 = "sha256-Xx+6GPAfjioTrqfFS7cFh6deraR+TtqLlwLbVQxfN8g=";
url = "https://api.k8slens.dev/binaries/Lens-${build}-arm64.dmg";
};
x86_64-linux = fetchurl {
sha256 = "sha256-DPgeAhM8k6RXg1Qw2bqJFLPh5q2o7Va6EAe/InQNXLg=";
url = "https://api.k8slens.dev/binaries/Lens-${build}.x86_64.AppImage";
};
};
}

View File

@ -1,18 +1,16 @@
{ lib, stdenv, undmg, fetchurl }: { lib, stdenv, undmg, fetchurl }:
let
common = import ./common.nix { inherit fetchurl; };
inherit (stdenv.hostPlatform) system;
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "lens"; inherit (common) pname version;
version = "2022.12"; src = common.sources.${system} or (throw "Source for ${pname} is not available for ${system}");
build = "${version}.11410-latest";
appName = "Lens"; appName = "Lens";
sourceRoot = "${appName}.app"; sourceRoot = "${appName}.app";
src = fetchurl {
url = "https://api.k8slens.dev/binaries/Lens-${build}-arm64.dmg";
sha256 = "sha256-PKWJ2CZ/wacbJnrCZdYwYJzbFVhjIGAw60UGhdw11Mc=";
};
buildInputs = [ undmg ]; buildInputs = [ undmg ];
installPhase = '' installPhase = ''
mkdir -p "$out/Applications/${appName}.app" mkdir -p "$out/Applications/${appName}.app"
@ -24,6 +22,6 @@ stdenv.mkDerivation rec {
homepage = "https://k8slens.dev/"; homepage = "https://k8slens.dev/";
license = licenses.lens; license = licenses.lens;
maintainers = with maintainers; [ dbirks ]; maintainers = with maintainers; [ dbirks ];
platforms = [ "aarch64-darwin" ]; platforms = [ "x86_64-darwin" "aarch64-darwin" ];
}; };
} }

View File

@ -1,5 +1,4 @@
{ stdenv, callPackage }: { stdenv, callPackage }:
if stdenv.isDarwin then if stdenv.isDarwin then
callPackage ./darwin.nix { } callPackage ./darwin.nix { }
else else

View File

@ -1,21 +1,16 @@
{ lib, fetchurl, appimageTools, wrapGAppsHook, makeWrapper }: { lib, fetchurl, appimageTools, makeWrapper, nss_latest, stdenv }:
let let
pname = "lens"; common = import ./common.nix { inherit fetchurl; };
version = "6.3.0";
build = "2022.12.221341-latest";
name = "${pname}-${version}";
src = fetchurl { inherit (stdenv.hostPlatform) system;
url = "https://api.k8slens.dev/binaries/Lens-${build}.x86_64.AppImage";
sha256 = "sha256-IJkm2Woz362jydFph9ek+5Jh2jtDH8kKvWoLQhTZPvc="; inherit (common) pname version;
name = "${pname}.AppImage"; src = common.sources.${stdenv.hostPlatform.system} or (throw "Source for ${pname} is not available for ${system}");
}; name = "${pname}-${version}";
appimageContents = appimageTools.extractType2 { appimageContents = appimageTools.extractType2 {
inherit name src; inherit name src;
}; };
in in
appimageTools.wrapType2 { appimageTools.wrapType2 {
inherit name src; inherit name src;
@ -26,14 +21,15 @@ appimageTools.wrapType2 {
source "${makeWrapper}/nix-support/setup-hook" source "${makeWrapper}/nix-support/setup-hook"
wrapProgram $out/bin/${pname} \ wrapProgram $out/bin/${pname} \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
install -m 444 -D ${appimageContents}/lens.desktop $out/share/applications/${pname}.desktop install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/lens.png \ install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/${pname}.png \
$out/share/icons/hicolor/512x512/apps/${pname}.png $out/share/icons/hicolor/512x512/apps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \ substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Icon=lens' 'Icon=${pname}' \
--replace 'Exec=AppRun' 'Exec=${pname}' --replace 'Exec=AppRun' 'Exec=${pname}'
''; '';
extraPkgs = _: [ nss_latest ];
meta = with lib; { meta = with lib; {
description = "The Kubernetes IDE"; description = "The Kubernetes IDE";
homepage = "https://k8slens.dev/"; homepage = "https://k8slens.dev/";