From 38b2bb3516fed3aaccd164cc958eaece19c5f5c6 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 18 Oct 2020 13:59:31 +0000 Subject: [PATCH] docker-images: simplify a bit by decompressing at push time This avoids Nix finding store paths in the output (because they're hidden), and thus adding weird extraneous dependencies to the closure. --- docker-images.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-images.nix b/docker-images.nix index 4e454ec701..4483f8c69a 100644 --- a/docker-images.nix +++ b/docker-images.nix @@ -13,12 +13,12 @@ let "registry.apps.k8s.lukegb.tech/depotcron/update_nixpkgs:latest" = depot.ops.maint.update_nixpkgs; }; + baseName = p: builtins.elemAt (builtins.match "^[a-z0-9]+-([^.]+).*$" (baseNameOf p)) 0; + crane = "${depot.nix.pkgs.crane}/bin/crane"; - decompress = drv: pkgs.runCommandNoCC "docker-image" {} '' - ${pkgs.gzip}/bin/gunzip -c ${drv} > $out - ''; pushCommands = lib.mapAttrsToList (name: value: '' - ${crane} push ${decompress value} ${name} + ${pkgs.gzip}/bin/gunzip -c ${value} > /tmp/push.tar + ${crane} push /tmp/push.tar ${name} '') images; authCommands = lib.mapAttrsToList (name: value: ''