From 54e6327e288a41c1ead755480d288e9712eb66b2 Mon Sep 17 00:00:00 2001 From: Diamondy Franc Date: Sun, 6 Aug 2023 01:45:17 +0300 Subject: [PATCH] lens: 6.3.0 -> 6.5.2 (#242911) --- .../networking/cluster/lens/common.nix | 22 ++++++++++++++++ .../networking/cluster/lens/darwin.nix | 18 ++++++------- .../networking/cluster/lens/default.nix | 1 - .../networking/cluster/lens/linux.nix | 26 ++++++++----------- 4 files changed, 41 insertions(+), 26 deletions(-) create mode 100644 pkgs/applications/networking/cluster/lens/common.nix diff --git a/pkgs/applications/networking/cluster/lens/common.nix b/pkgs/applications/networking/cluster/lens/common.nix new file mode 100644 index 000000000000..e14a176bf464 --- /dev/null +++ b/pkgs/applications/networking/cluster/lens/common.nix @@ -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"; + }; + }; +} diff --git a/pkgs/applications/networking/cluster/lens/darwin.nix b/pkgs/applications/networking/cluster/lens/darwin.nix index d9d46895d379..e8f17422ec1f 100644 --- a/pkgs/applications/networking/cluster/lens/darwin.nix +++ b/pkgs/applications/networking/cluster/lens/darwin.nix @@ -1,18 +1,16 @@ { lib, stdenv, undmg, fetchurl }: - +let + common = import ./common.nix { inherit fetchurl; }; + inherit (stdenv.hostPlatform) system; +in stdenv.mkDerivation rec { - pname = "lens"; - version = "2022.12"; - build = "${version}.11410-latest"; + inherit (common) pname version; + src = common.sources.${system} or (throw "Source for ${pname} is not available for ${system}"); + appName = "Lens"; sourceRoot = "${appName}.app"; - src = fetchurl { - url = "https://api.k8slens.dev/binaries/Lens-${build}-arm64.dmg"; - sha256 = "sha256-PKWJ2CZ/wacbJnrCZdYwYJzbFVhjIGAw60UGhdw11Mc="; - }; - buildInputs = [ undmg ]; installPhase = '' mkdir -p "$out/Applications/${appName}.app" @@ -24,6 +22,6 @@ stdenv.mkDerivation rec { homepage = "https://k8slens.dev/"; license = licenses.lens; maintainers = with maintainers; [ dbirks ]; - platforms = [ "aarch64-darwin" ]; + platforms = [ "x86_64-darwin" "aarch64-darwin" ]; }; } diff --git a/pkgs/applications/networking/cluster/lens/default.nix b/pkgs/applications/networking/cluster/lens/default.nix index 937c694e0e8e..455065b07036 100644 --- a/pkgs/applications/networking/cluster/lens/default.nix +++ b/pkgs/applications/networking/cluster/lens/default.nix @@ -1,5 +1,4 @@ { stdenv, callPackage }: - if stdenv.isDarwin then callPackage ./darwin.nix { } else diff --git a/pkgs/applications/networking/cluster/lens/linux.nix b/pkgs/applications/networking/cluster/lens/linux.nix index 503fb36860ce..8a21ceb432da 100644 --- a/pkgs/applications/networking/cluster/lens/linux.nix +++ b/pkgs/applications/networking/cluster/lens/linux.nix @@ -1,21 +1,16 @@ -{ lib, fetchurl, appimageTools, wrapGAppsHook, makeWrapper }: - +{ lib, fetchurl, appimageTools, makeWrapper, nss_latest, stdenv }: let - pname = "lens"; - version = "6.3.0"; - build = "2022.12.221341-latest"; - name = "${pname}-${version}"; + common = import ./common.nix { inherit fetchurl; }; - src = fetchurl { - url = "https://api.k8slens.dev/binaries/Lens-${build}.x86_64.AppImage"; - sha256 = "sha256-IJkm2Woz362jydFph9ek+5Jh2jtDH8kKvWoLQhTZPvc="; - name = "${pname}.AppImage"; - }; + inherit (stdenv.hostPlatform) system; + + inherit (common) pname version; + src = common.sources.${stdenv.hostPlatform.system} or (throw "Source for ${pname} is not available for ${system}"); + name = "${pname}-${version}"; appimageContents = appimageTools.extractType2 { inherit name src; }; - in appimageTools.wrapType2 { inherit name src; @@ -26,14 +21,15 @@ appimageTools.wrapType2 { source "${makeWrapper}/nix-support/setup-hook" wrapProgram $out/bin/${pname} \ --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}/usr/share/icons/hicolor/512x512/apps/lens.png \ + install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop + install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/${pname}.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}' ''; + extraPkgs = _: [ nss_latest ]; + meta = with lib; { description = "The Kubernetes IDE"; homepage = "https://k8slens.dev/";