Merge pull request #301704 from a-n-n-a-l-e-e/throw-unsupported-src

treewide: throw on unsupported system src access
This commit is contained in:
a-n-n-a-l-e-e 2024-04-05 14:20:30 -07:00 committed by GitHub
commit 76422a767b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 18 additions and 18 deletions

View File

@ -39,7 +39,7 @@ in stdenv.mkDerivation rec {
releasePath
else
let
platform = platforms.${stdenv.system};
platform = platforms.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
urlVersion = lib.replaceStrings [ "." ] [ "_" ] version;
in fetchurl {
url =

View File

@ -13,7 +13,7 @@ let
hash = "sha256-Ihk3InHB3/tEYRqH2ozhokz2GN8Gfig5DJkO/8P1LJs=";
};
};
src = srcs.${stdenv.hostPlatform.system};
src = srcs.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
meta = with lib; {
description = "User-friendly Desktop Internet GIS";

View File

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
url = "https://download.brother.com/welcome/dlf006645/${pname}-${version}.amd64.deb";
sha256 = "sha256-Gpr5456MCNpyam3g2qPo7S3aEZFMaUGR8bu7YmRY8xk=";
};
}."${stdenv.hostPlatform.system}";
}."${stdenv.hostPlatform.system}" or (throw "unsupported system ${stdenv.hostPlatform.system}");
unpackPhase = ''
ar x $src

View File

@ -51,7 +51,7 @@ let
};
src = fetchurl {
inherit (sources.${channel}.${stdenv.system}) url hash;
inherit (sources.${channel}.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}")) url hash;
};
meta = with lib; {

View File

@ -35,7 +35,7 @@ let
src = fetchurl {
url = "mirror://apache/hadoop/common/hadoop-${finalAttrs.version}/hadoop-${finalAttrs.version}"
+ optionalString stdenv.isAarch64 "-aarch64" + ".tar.gz";
inherit (platformAttrs.${stdenv.system}) hash;
inherit (platformAttrs.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}")) hash;
};
doCheck = true;

View File

@ -52,7 +52,7 @@ let
};
aarch64-darwin = x86_64-darwin;
};
src = srcs.${stdenv.hostPlatform.system}.${branch};
src = srcs.${stdenv.hostPlatform.system}.${branch} or (throw "${stdenv.hostPlatform.system} not supported on ${branch}");
meta = with lib; {
description = "All-in-one cross-platform voice and text chat for gamers";

View File

@ -49,7 +49,7 @@ let
# If we don't have a platform available, put a dummy version here, so at
# least evaluation succeeds.
sources =
(lib.importJSON ./sources.json).${stdenv.system} or { picoscope.version = "unknown"; };
(lib.importJSON ./sources.json).${stdenv.system} or (throw "unsupported system ${stdenv.system}");
scopePkg = name:
{ url, version, sha256 }:

View File

@ -15,7 +15,7 @@ let
sha256 = "sha256-EuWGbn6qggi8/9Rci8iaXfuVKE+QXb1BHEYDvotR/q4=";
};
};
src = srcs.${stdenv.hostPlatform.system};
src = srcs.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
contents = appimageTools.extract { inherit name src; };

View File

@ -13,7 +13,7 @@ let
dlbin = sha256: fetchurl {
url = "${baseurl}/v${version}/firecracker-v${version}-${suffix}.tgz";
sha256 = sha256."${stdenv.hostPlatform.system}";
sha256 = sha256."${stdenv.hostPlatform.system}"or (throw "unsupported system ${stdenv.hostPlatform.system}");
};
in

View File

@ -80,7 +80,7 @@ let result = stdenv.mkDerivation rec {
in requireFile {
name = "jdk-${productVersion}u${patchVersion}-${platformName}.tar.gz";
url = "http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html";
sha256 = sha256.${stdenv.hostPlatform.system};
sha256 = sha256.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
};
nativeBuildInputs = [ file makeWrapper ]

View File

@ -24,7 +24,7 @@ let
sourcePerArch.${cpuName}.version or (throw "unsupported CPU ${cpuName}");
src = fetchurl {
inherit (sourcePerArch.${cpuName}) url sha256;
inherit (sourcePerArch.${cpuName} or (throw "unsupported system ${stdenv.hostPlatform.system}")) url sha256;
};
# See: https://github.com/NixOS/patchelf/issues/10

View File

@ -73,7 +73,7 @@ let
platforms."aarch64-linux".sha256 = "16sbfk599h96wcsmpbxlwsvq0n1pssmm8dpwmjsqfrn1464dvs68";
platforms."x86_64-linux".sha256 = "1wa4nv28saz96kar9svdarfz6c4rnbcqz0rqxzl9zclnhfzhqdiw";
platformInfo = builtins.getAttr stdenv.hostPlatform.system platforms;
platformInfo = platforms.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation rec {
pname = "cef-binary";

View File

@ -20,7 +20,7 @@ in
stdenv.mkDerivation {
inherit version;
pname = "meteor";
src = srcs.${system};
src = srcs.${system} or (throw "unsupported system ${system}");
#dontStrip = true;

View File

@ -37,7 +37,7 @@ stdenv.mkDerivation {
pname = "rar";
inherit version;
src = fetchurl (srcs.${stdenv.hostPlatform.system});
src = fetchurl (srcs.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"));
dontBuild = true;

View File

@ -26,7 +26,7 @@ stdenv.mkDerivation {
inherit version;
pname = "geekbench";
src = fetchurl (sources.${stdenv.system});
src = fetchurl (sources.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"));
dontConfigure = true;
dontBuild = true;

View File

@ -27,7 +27,7 @@ stdenv.mkDerivation {
inherit version;
pname = "geekbench";
src = fetchurl (sources.${stdenv.system});
src = fetchurl (sources.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"));
dontConfigure = true;
dontBuild = true;

View File

@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
url = "https://github.com/manga-download/hakuneko/releases/download/v${version}/hakuneko-desktop_${version}_linux_i386.deb";
sha256 = "32017d26bafffaaf0a83dd6954d3926557014af4022a972371169c56c0e3d98b";
};
}."${stdenv.hostPlatform.system}";
}."${stdenv.hostPlatform.system}" or (throw "unsupported system ${stdenv.hostPlatform.system}");
dontBuild = true;
dontConfigure = true;

View File

@ -19,7 +19,7 @@ in stdenv.mkDerivation rec {
inherit version;
pname = "sonar-scanner-cli";
src = fetchurl sonarScannerArchPackage.${stdenv.hostPlatform.system};
src = fetchurl sonarScannerArchPackage.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
nativeBuildInputs = [ unzip ];