Skip to content

Commit

Permalink
Merge pull request #301704 from a-n-n-a-l-e-e/throw-unsupported-src
Browse files Browse the repository at this point in the history
treewide: throw on unsupported system src access
  • Loading branch information
a-n-n-a-l-e-e authored Apr 5, 2024
2 parents 48611b7 + 0d7dc0e commit 76422a7
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkgs/applications/audio/renoise/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/gis/udig/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/1password-gui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/cluster/hadoop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; };

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/virtualization/firecracker/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libcef/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/meteor/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ in
stdenv.mkDerivation {
inherit version;
pname = "meteor";
src = srcs.${system};
src = srcs.${system} or (throw "unsupported system ${system}");

#dontStrip = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/archivers/rar/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/misc/geekbench/5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/misc/geekbench/6.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/misc/hakuneko/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/security/sonar-scanner-cli/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];

Expand Down

0 comments on commit 76422a7

Please sign in to comment.