3
0
Fork 0
forked from mirrors/nixpkgs

chromium/updater: Don't import <nixpkgs> again

This effectively resets the attributes given at the point the main
<nixpkgs> 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 <nixpkgs> 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 <aszlig@redmoonstudios.org>
Fixes: #15225
This commit is contained in:
aszlig 2016-05-04 22:11:50 +02:00
parent 0bc713f817
commit f28b71023c
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961
2 changed files with 12 additions and 7 deletions

View file

@ -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

View file

@ -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