aboutsummaryrefslogtreecommitdiff
path: root/shell.nix
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2022-11-29 21:26:41 +0000
committerAlex <alex@adnab.me>2022-11-29 21:26:41 +0000
commit448dcc5cf4685f6a321b84ba1aa38e560f63a90a (patch)
tree5318ef82fd95e007e6738cce58fd22c9f446a886 /shell.nix
parent280330ac72a12fbfb9c22018bb33d5a490c7a016 (diff)
parent60c26fbc628d7b450ae39214b578ab6a30583d5c (diff)
downloadgarage-448dcc5cf4685f6a321b84ba1aa38e560f63a90a.tar.gz
garage-448dcc5cf4685f6a321b84ba1aa38e560f63a90a.zip
Merge pull request 'Make repository into a Nix flake' (#424) from nix-remove-system into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/424
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix16
1 files changed, 14 insertions, 2 deletions
diff --git a/shell.nix b/shell.nix
index 480bc349..10058fc4 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,5 +1,5 @@
{
- system ? builtins.currentSystem,
+ system ? builtins.currentSystem,
}:
with import ./nix/common.nix;
@@ -71,13 +71,25 @@ function refresh_cache {
for attr in clippy.amd64 test.amd64 pkgs.{amd64,i386,arm,arm64}.{debug,release}; do
echo "Updating cache for ''${attr}"
derivation=$(nix-instantiate --attr ''${attr})
- nix copy \
+ nix copy -j8 \
--to 's3://nix?endpoint=garage.deuxfleurs.fr&region=garage&secret-key=/tmp/nix-signing-key.sec' \
$(nix-store -qR ''${derivation%\!bin})
done
rm /tmp/nix-signing-key.sec
}
+function refresh_flake_cache {
+ pass show deuxfleurs/nix_priv_key > /tmp/nix-signing-key.sec
+ for attr in packages.x86_64-linux.default; do
+ echo "Updating cache for ''${attr}"
+ derivation=$(nix path-info --derivation ".#''${attr}")
+ nix copy -j8 \
+ --to 's3://nix?endpoint=garage.deuxfleurs.fr&region=garage&secret-key=/tmp/nix-signing-key.sec' \
+ $(nix-store -qR ''${derivation})
+ done
+ rm /tmp/nix-signing-key.sec
+}
+
function to_s3 {
aws \
--endpoint-url https://garage.deuxfleurs.fr \