summary refs log tree commit diff
diff options
context:
space:
mode:
authorDiamondy Franc <diamondy4@hotmail.com>2023-08-06 01:45:17 +0300
committerGitHub <noreply@github.com>2023-08-06 00:45:17 +0200
commit54e6327e288a41c1ead755480d288e9712eb66b2 (patch)
treefbe863c4641e327bd8cce4e8829576ead9702e8b
parent09464624ddd186547ad899464b0ab29034a64397 (diff)
downloadnixpkgs-54e6327e288a41c1ead755480d288e9712eb66b2.tar
nixpkgs-54e6327e288a41c1ead755480d288e9712eb66b2.tar.gz
nixpkgs-54e6327e288a41c1ead755480d288e9712eb66b2.tar.bz2
nixpkgs-54e6327e288a41c1ead755480d288e9712eb66b2.tar.lz
nixpkgs-54e6327e288a41c1ead755480d288e9712eb66b2.tar.xz
nixpkgs-54e6327e288a41c1ead755480d288e9712eb66b2.tar.zst
nixpkgs-54e6327e288a41c1ead755480d288e9712eb66b2.zip
lens: 6.3.0 -> 6.5.2 (#242911)
-rw-r--r--pkgs/applications/networking/cluster/lens/common.nix22
-rw-r--r--pkgs/applications/networking/cluster/lens/darwin.nix18
-rw-r--r--pkgs/applications/networking/cluster/lens/default.nix1
-rw-r--r--pkgs/applications/networking/cluster/lens/linux.nix26
4 files changed, 41 insertions, 26 deletions
diff --git a/pkgs/applications/networking/cluster/lens/common.nix b/pkgs/applications/networking/cluster/lens/common.nix
new file mode 100644
index 00000000000..e14a176bf46
--- /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 d9d46895d37..e8f17422ec1 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 937c694e0e8..455065b0703 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 503fb36860c..8a21ceb432d 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/";