about summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers/chromium/update.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-05-04 22:11:50 +0200
committeraszlig <aszlig@redmoonstudios.org>2016-05-04 22:35:24 +0200
commitf28b71023cba59ba819b0978ebffa70e3e4d1785 (patch)
treebeb1c93c791c6c0a63e73fbed75ef784137ed5aa /pkgs/applications/networking/browsers/chromium/update.nix
parent0bc713f817e08234a931d1cfee10f908e33dcb88 (diff)
downloadnixlib-f28b71023cba59ba819b0978ebffa70e3e4d1785.tar
nixlib-f28b71023cba59ba819b0978ebffa70e3e4d1785.tar.gz
nixlib-f28b71023cba59ba819b0978ebffa70e3e4d1785.tar.bz2
nixlib-f28b71023cba59ba819b0978ebffa70e3e4d1785.tar.lz
nixlib-f28b71023cba59ba819b0978ebffa70e3e4d1785.tar.xz
nixlib-f28b71023cba59ba819b0978ebffa70e3e4d1785.tar.zst
nixlib-f28b71023cba59ba819b0978ebffa70e3e4d1785.zip
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
Diffstat (limited to 'pkgs/applications/networking/browsers/chromium/update.nix')
-rw-r--r--pkgs/applications/networking/browsers/chromium/update.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/update.nix b/pkgs/applications/networking/browsers/chromium/update.nix
index cff841995624..bd7e256bfa9d 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