From d9cc0c9de1e39391721d653dd3806317ab818ed6 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Fri, 22 May 2020 13:04:17 +0100 Subject: [PATCH] ops/nixos/lib: don't use the s3 binary cache except when rebuilder-ing. --- ops/nixos/lib/common.nix | 2 +- ops/nixos/lib/rebuilder.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ops/nixos/lib/common.nix b/ops/nixos/lib/common.nix index 009f46e74a..f8bae699ac 100644 --- a/ops/nixos/lib/common.nix +++ b/ops/nixos/lib/common.nix @@ -8,7 +8,7 @@ in nix = { nixPath = [ "depot=/home/lukegb/depot/" "nixpkgs=/home/lukegb/depot/third_party/nixpkgs/" ]; trustedUsers = [ "root" "@wheel" ]; - binaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; + binaryCaches = lib.mkForce [ "https://cache.nixos.org/" ]; trustedBinaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; }; nixpkgs.config = { allowUnfree = true; }; diff --git a/ops/nixos/lib/rebuilder.nix b/ops/nixos/lib/rebuilder.nix index bdf367d083..e8f5eb841d 100644 --- a/ops/nixos/lib/rebuilder.nix +++ b/ops/nixos/lib/rebuilder.nix @@ -10,7 +10,7 @@ pkgs.writeShellScriptBin "rebuilder" '' export AWS_ACCESS_KEY_ID="${depot.ops.secrets.nixCache.AWS_ACCESS_KEY_ID}" export AWS_SECRET_ACCESS_KEY="${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}" - system="$(nix-build -E "(import $DEPOT_PATH {}).ops.nixos.${system}" --no-out-link)" + system="$(nix-build --option substituters "https://cache.nixos.org s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" -E "(import $DEPOT_PATH {}).ops.nixos.${system}" --no-out-link)" nix-env -p /nix/var/nix/profiles/system --set "$system" "$system/bin/switch-to-configuration" switch ''