From 37dbd62a83874cccb766a11e4e28ba88f226614e Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 20 Mar 2016 17:13:12 +0100 Subject: [PATCH] chromium: Move fetchurl calls to getChannel We always do something like "fetchurl channelProduct", so let's move it to getChannel directly so we can avoid those fetchurl calls all over the place. Also, we can still access subattributes from the fetchurl call if we need to, so there really is no need to expose the product's attributes directly. Signed-off-by: aszlig --- .../networking/browsers/chromium/source/default.nix | 6 +++--- pkgs/applications/networking/browsers/chromium/update.nix | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/source/default.nix b/pkgs/applications/networking/browsers/chromium/source/default.nix index 394dd81cc2f2..6e0decbca25d 100644 --- a/pkgs/applications/networking/browsers/chromium/source/default.nix +++ b/pkgs/applications/networking/browsers/chromium/source/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fetchpatch, patchutils, python +{ stdenv, fetchpatch, patchutils, python , channel ? "stable" }: @@ -19,7 +19,7 @@ let in stdenv.mkDerivation { name = "chromium-source-${version}"; - src = fetchurl main; + src = main; buildInputs = [ python ]; # cannot patch shebangs otherwise @@ -73,6 +73,6 @@ in stdenv.mkDerivation { passthru = { inherit version channel; - plugins = fetchurl binary; + plugins = binary; }; } diff --git a/pkgs/applications/networking/browsers/chromium/update.nix b/pkgs/applications/networking/browsers/chromium/update.nix index d9c4e6a56e40..150031ab7889 100644 --- a/pkgs/applications/networking/browsers/chromium/update.nix +++ b/pkgs/applications/networking/browsers/chromium/update.nix @@ -3,7 +3,7 @@ let inherit (import ../../../../../. { inherit system; - }) lib runCommand writeText stdenv curl cacert nix; + }) lib runCommand fetchurl writeText stdenv curl cacert nix; sources = if builtins.pathExists ./upstream-info.nix then import ./upstream-info.nix @@ -34,12 +34,12 @@ in rec { in { inherit (chanAttrs) version; - main = { + main = fetchurl { url = mkVerURL chanAttrs.version; inherit (chanAttrs) sha256; }; - binary = let + binary = fetchurl (let mkUrls = arch: let mkURLForMirror = getDebURL channel chanAttrs.version arch; in map mkURLForMirror ([ debURL ] ++ debMirrors); @@ -49,7 +49,7 @@ in rec { } else if !stdenv.is64bit && chanAttrs ? sha256bin32 then { urls = mkUrls "i386"; sha256 = chanAttrs.sha256bin32; - } else throw "No Chrome plugins are available for your architecture."; + } else throw "No Chrome plugins are available for your architecture."); }; update = let