mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-10 23:13:56 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
42 lines
1.2 KiB
Nix
42 lines
1.2 KiB
Nix
{ stdenv
|
|
, callPackage
|
|
, fetchurl
|
|
, lib }:
|
|
|
|
let
|
|
|
|
pname = "lens-desktop";
|
|
version = "2024.3.191333";
|
|
|
|
sources = {
|
|
x86_64-linux = {
|
|
url = "https://api.k8slens.dev/binaries/Lens-${version}-latest.x86_64.AppImage";
|
|
hash = "sha256-OywOjXzeW/5uyt50JrutiLgem9S1CrlwPFqfK6gUc7U=";
|
|
};
|
|
x86_64-darwin = {
|
|
url = "https://api.k8slens.dev/binaries/Lens-${version}-latest.dmg";
|
|
hash = "sha256-yf+WBcOdOM3XsfiXJThVws2r84vG2jwfNV1c+sq6A4s=";
|
|
};
|
|
aarch64-darwin = {
|
|
url = "https://api.k8slens.dev/binaries/Lens-${version}-latest-arm64.dmg";
|
|
hash = "sha256-hhd8MnwKWpvG7UebkeEoztS45SJVnpvvJ9Zy+y5swik=";
|
|
};
|
|
};
|
|
|
|
src = fetchurl {
|
|
inherit (sources.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}")) url hash;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Kubernetes IDE";
|
|
homepage = "https://k8slens.dev/";
|
|
license = licenses.lens;
|
|
maintainers = with maintainers; [ dbirks RossComputerGuy starkca90 ];
|
|
platforms = builtins.attrNames sources;
|
|
};
|
|
|
|
in if stdenv.hostPlatform.isDarwin then
|
|
callPackage ./darwin.nix { inherit pname version src meta; }
|
|
else
|
|
callPackage ./linux.nix { inherit pname version src meta; }
|