about summary refs log tree commit diff
path: root/tools/nixery
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-09-01T22·55+0100
committerVincent Ambo <github@tazj.in>2019-09-01T23·08+0100
commitce8635833b226df8497be34a8009d0e47cb0399e (patch)
treeca2a5f2ff325998a825b7bfebb72b4a156596892 /tools/nixery
parent92270fcbe472c2cef3cbd8f3f92b950aa78bc777 (diff)
refactor(build-image): Remove implicit import of entire package set
Explicitly refer to where things come from, and also don't import
dockerTools as it is no longer used for anything.
Diffstat (limited to 'tools/nixery')
-rw-r--r--tools/nixery/build-image/build-image.nix13
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/nixery/build-image/build-image.nix b/tools/nixery/build-image/build-image.nix
index 7b0f2cac9739..cd0ef91b3135 100644
--- a/tools/nixery/build-image/build-image.nix
+++ b/tools/nixery/build-image/build-image.nix
@@ -39,14 +39,11 @@
   ...
 }:
 
-# Since this is essentially a re-wrapping of some of the functionality that is
-# implemented in the dockerTools, we need all of its components in our top-level
-# namespace.
 with builtins;
-with pkgs;
-with dockerTools;
 
 let
+  inherit (pkgs) lib runCommand writeText;
+
   tarLayer = "application/vnd.docker.image.rootfs.diff.tar";
   baseName = baseNameOf name;
 
@@ -150,7 +147,7 @@ let
                                    groupedLayers));
 
   # Create a symlink forest into all top-level store paths.
-  contentsEnv = symlinkJoin {
+  contentsEnv = pkgs.symlinkJoin {
     name = "bulk-layers";
     paths = allContents.contents;
   };
@@ -172,7 +169,7 @@ let
   # This computes both an MD5 and a SHA256 hash of each layer, which are used
   # for different purposes. See the registry server implementation for details.
   allLayersJson = runCommand "fs-layer-list.json" {
-    buildInputs = [ coreutils findutils jq openssl ];
+    buildInputs = with pkgs; [ coreutils jq openssl ];
   } ''
       cat ${bulkLayers} | sort -t/ -k5 -n > layer-list
       echo ${customisationLayer} >> layer-list
@@ -204,7 +201,7 @@ let
   };
   configJson = writeText "${baseName}-config.json" (toJSON config);
   configMetadata = fromJSON (readFile (runCommand "config-meta" {
-    buildInputs = [ jq openssl ];
+    buildInputs = with pkgs; [ jq openssl ];
   } ''
     size=$(wc -c ${configJson} | cut -d ' ' -f1)
     sha256=$(sha256sum ${configJson} | cut -d ' ' -f1)