Skip to content

Commit

Permalink
nextcloud{28,29}Packages: improve generation script
Browse files Browse the repository at this point in the history
The script can now be executed from an arbitrary location and doesn't
require Nix's experimental features to be enabled.
  • Loading branch information
dotlambda committed Jul 18, 2024
1 parent f033e5f commit 0fde477
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkgs/servers/nextcloud/packages/generate.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env nix-shell
#! nix-shell -I nixpkgs=../../../.. -i bash -p jq gnused curl
#! nix-shell -i bash -p jq gnused curl

set -e
set -u
set -o pipefail
set -x

cd $(dirname -- "${BASH_SOURCE[0]}")

export NEXTCLOUD_VERSIONS=$(nix-instantiate --eval -E 'import ./nc-versions.nix {}' -A e)

APPS=$(jq -r 'keys|.[]' nextcloud-apps.json | sed -z 's/\n/,/g;s/,$/\n/')
Expand All @@ -30,7 +32,7 @@ for v in ${NEXTCLOUD_VERSIONS//,/ }; do
# Get all of our variables
VERSION=$(jq -r ".[] | select(.id == \"${a}\") | .releases[0].version" "$APPS_PER_VERSION")
URL=$(jq -r ".[] | select(.id == \"${a}\") | .releases[0].download" "$APPS_PER_VERSION")
HASH=$(nix store prefetch-file --json --hash-type sha256 --unpack "$URL" | jq -r .hash)
HASH=$(nix --extra-experimental-features nix-command store prefetch-file --json --hash-type sha256 --unpack "$URL" | jq -r .hash)
HOMEPAGE=$(jq -r ".[] | select(.id == \"${a}\") | .website" "$APPS_PER_VERSION")
DESCRIPTION=$(jq ".[] | select(.id == \"${a}\") | .translations.en.description" "$APPS_PER_VERSION")
# Add all variables to the file
Expand Down

0 comments on commit 0fde477

Please sign in to comment.