nixos/scripts/personal-cache.sh
Malte Tammena 73ffca6989 [flake] Extract devShell scripts
Also start using writeShellApplication.
2022-04-18 18:12:36 +02:00

21 lines
400 B
Bash

store="http://elysia-clarki:5000"
action="$1"
function print_help() {
printf "Usage:\n"
printf " %s [ ping | url ]" "$0"
exit 1
}
if [ -z "${action+x}" ]; then
print_help
elif [ "$action" = "--ping" ]; then
nix store ping --store "$store" --option connect-timeout 1 --option download-attempt 1 2>/dev/null
elif [ "$action" = "--url" ]; then
printf "%s" "$store"
else
print_help
fi