custom-nixpkgs/update.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.0 KiB
Bash
Raw Normal View History

2021-07-21 03:46:24 +05:30
#!/usr/bin/env bash
set -euxo pipefail
2022-06-13 13:27:52 +05:30
declare -a ALL_PACKAGES=(
2021-07-24 02:17:29 +05:30
adb-sync
2023-01-09 22:10:17 +05:30
adbtuifm
adx
2022-07-02 15:48:19 +05:30
bundletool-bin
2021-11-28 16:11:39 +05:30
clipboard-substitutor
2021-07-25 04:16:50 +05:30
gdrive
2023-05-11 16:44:33 +05:30
gitice
hcctl
healthchecks-monitor
2023-01-09 22:10:17 +05:30
hyperlink
2022-05-31 15:55:07 +05:30
katbin
linkleaner
monocraft-nerdfonts
2023-04-23 19:00:12 +05:30
patreon-dl
pidcat
rucksack
2023-01-09 22:10:17 +05:30
twt
2022-03-07 13:30:32 +05:30
when
2021-07-21 03:46:24 +05:30
)
2022-06-13 13:27:52 +05:30
declare -A VERSION_REGEX=(
["hcctl"]="hcctl-v(.*)"
["healthchecks-monitor"]="healthchecks-monitor-v(.*)"
)
2023-01-09 21:58:48 +05:30
PKG="${1-}"
VERSION="${2-}"
NO_BUILD="${NO_BUILD-}"
2022-06-13 13:27:52 +05:30
declare -a PACKAGES_TO_BUILD=()
declare -a BASE_PARAMS=("--commit")
if [ -z "${NO_BUILD}" ]; then
2022-06-13 13:27:52 +05:30
BASE_PARAMS+=("--build")
fi
2021-07-24 02:10:21 +05:30
if [ -z "${PKG}" ]; then
PACKAGES_TO_BUILD+=("${ALL_PACKAGES[@]}")
else
2022-06-13 13:27:52 +05:30
PACKAGES_TO_BUILD+=("${PKG}")
fi
2022-06-13 13:27:52 +05:30
for PACKAGE in "${PACKAGES_TO_BUILD[@]}"; do
declare -a PARAMS=("${BASE_PARAMS[@]}")
if [[ -v VERSION_REGEX["${PACKAGE}"] ]]; then
2022-06-13 13:27:52 +05:30
PARAMS+=("--version-regex")
PARAMS+=("${VERSION_REGEX["${PACKAGE}"]}")
2022-06-13 13:27:52 +05:30
fi
if [ -n "${VERSION}" ]; then
PARAMS+=("--version")
PARAMS+=("${VERSION}")
fi
PARAMS+=("${PACKAGE}")
2022-06-13 13:27:52 +05:30
nix-update "${PARAMS[@]}"
done