From f28b71023cba59ba819b0978ebffa70e3e4d1785 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 4 May 2016 22:11:50 +0200 Subject: [PATCH] chromium/updater: Don't import again This effectively resets the attributes given at the point the main is imported and thus for example is also reading in stuff like ~/.nixpkgs/config.nix again, which might lead to unexpected results. We now only import now if the updater is auto-called (like in update.sh), otherwise the required attributes are passed by callPackage within the Chromium scope. I remember noting about this a while ago either on IRC or on GitHub, but I can't find it right now, so thanks to @obadz for reminding me about this in #15225. Tested this by running the updater and also using: NIXPKGS_CONFIG=$(pwd)/broken.nix nix-instantiate --arg config {} -A chromium The contents of broken.nix were: EVALERR{ Signed-off-by: aszlig Fixes: #15225 --- .../networking/browsers/chromium/default.nix | 4 +--- .../networking/browsers/chromium/update.nix | 15 +++++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index 5f9c423ce44..5a3b289d528 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -19,9 +19,7 @@ let callPackage = newScope chromium; chromium = { - upstream-info = (import ./update.nix { - inherit (stdenv) system; - }).getChannel channel; + upstream-info = (callPackage ./update.nix {}).getChannel channel; mkChromiumDerivation = callPackage ./common.nix { inherit enableSELinux enableNaCl enableHotwording gnomeSupport diff --git a/pkgs/applications/networking/browsers/chromium/update.nix b/pkgs/applications/networking/browsers/chromium/update.nix index cff84199562..bd7e256bfa9 100644 --- a/pkgs/applications/networking/browsers/chromium/update.nix +++ b/pkgs/applications/networking/browsers/chromium/update.nix @@ -1,9 +1,16 @@ -{ system ? builtins.currentSystem }: +let maybePkgs = import ../../../../../. {}; in + +{ stdenv ? maybePkgs.stdenv +, runCommand ? maybePkgs.runCommand +, fetchurl ? maybePkgs.fetchurl +, writeText ? maybePkgs.writeText +, curl ? maybePkgs.curl +, cacert ? maybePkgs.cacert +, nix ? maybePkgs.nix +}: let - inherit (import ../../../../../. { - inherit system; - }) lib runCommand fetchurl writeText stdenv curl cacert nix; + inherit (stdenv) lib; sources = if builtins.pathExists ./upstream-info.nix then import ./upstream-info.nix