forked from reflex-frp/reflex-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache
More file actions
executable file
·21 lines (13 loc) · 857 Bytes
/
cache
File metadata and controls
executable file
·21 lines (13 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
set -eu
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "$DIR/common-setup.sh"
CONFIG_DIR="$HOME/.reflex-platform"
TMPDIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'cache')
trap "rm -rf \"$TMPDIR\"" EXIT
(
cd "$DIR"
nix-push --dest "$TMPDIR" --key-file ~/.reflex-platform/ryantrinkle.com-1 "$(nix-instantiate $NIXOPTS --add-root "$DIR/gc-roots/cache.drv" --indirect -E "import ./cache.nix")"
sed -i '/^\(System\|Deriver\): /d' "$TMPDIR/"* # Get rid of these, because they can vary in apparently-meaningless between systems
nix-shell $NIXOPTS -E 'with import <nixpkgs> {}; runCommand "shell" { buildInputs = [ s3cmd ]; shellHook = "export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"; } ""' --run "s3cmd --config=$CONFIG_DIR/s3cfg sync --no-delete-removed '$TMPDIR/' s3://nixcache.reflex-frp.org/"
)