mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
deploy: allow specifying urls not ending with source.tar.gz
For example, the official bootstrap ones.
This commit is contained in:
parent
5e7d6d1214
commit
9ba1feced2
1 changed files with 13 additions and 4 deletions
|
|
@ -13,8 +13,9 @@ flake) and uploads it to the directory specified in <rsync_target>. The
|
||||||
contents of this directory should be reachable by the android device with
|
contents of this directory should be reachable by the android device with
|
||||||
<public_url>.
|
<public_url>.
|
||||||
|
|
||||||
Example:
|
Examples:
|
||||||
$ nix run .#deploy -- 'https://example.com/bootstrap' 'user@host:/path/to/bootstrap'
|
$ nix run .#deploy -- 'https://example.com/bootstrap/source.tar.gz' 'user@host:/path/to/bootstrap'
|
||||||
|
$ nix run .#deploy -- 'github:USER/nix-on-droid/BRANCH' 'user@host:/path/to/bootstrap'
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -35,6 +36,16 @@ function log() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "$PUBLIC_URL" =~ ^github:(.*)/(.*)/(.*) ]]; then
|
||||||
|
export NIX_ON_DROID_CHANNEL_URL="https://github.com/${BASH_REMATCH[1]}/${BASH_REMATCH[2]}/archive/${BASH_REMATCH[3]}.tar.gz"
|
||||||
|
else
|
||||||
|
[[ "$PUBLIC_URL" =~ ^https?:// ]] || \
|
||||||
|
{ echo "unsupported url $PUBLIC_URL" >&2; exit 1; }
|
||||||
|
export NIX_ON_DROID_CHANNEL_URL="$PUBLIC_URL"
|
||||||
|
fi
|
||||||
|
export NIX_ON_DROID_FLAKE_URL="$PUBLIC_URL"
|
||||||
|
|
||||||
|
|
||||||
log "building proot..."
|
log "building proot..."
|
||||||
PROOT="$(nix build --no-link --print-out-paths ".#prootTermux")"
|
PROOT="$(nix build --no-link --print-out-paths ".#prootTermux")"
|
||||||
|
|
||||||
|
|
@ -47,8 +58,6 @@ grep "prootStatic = \"/nix/store/" "$PROOT_HASH_FILE"
|
||||||
|
|
||||||
|
|
||||||
log "building bootstrapZip..."
|
log "building bootstrapZip..."
|
||||||
export NIX_ON_DROID_CHANNEL_URL="$PUBLIC_URL/$SOURCE_FILE"
|
|
||||||
export NIX_ON_DROID_FLAKE_URL="$PUBLIC_URL/$SOURCE_FILE"
|
|
||||||
BOOTSTRAP_ZIP="$(nix build --no-link --print-out-paths --impure ".#bootstrapZip")"
|
BOOTSTRAP_ZIP="$(nix build --no-link --print-out-paths --impure ".#bootstrapZip")"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue