Skip to content

Instantly share code, notes, and snippets.

@shift
Created March 8, 2026 00:01
Show Gist options
  • Select an option

  • Save shift/2882d4c7d798a72f546cad37223a917c to your computer and use it in GitHub Desktop.

Select an option

Save shift/2882d4c7d798a72f546cad37223a917c to your computer and use it in GitHub Desktop.
{ pkgs ? import <nixpkgs> {} }:
pkgs.writeShellApplication {
name = "cash-bio";
runtimeInputs = with pkgs; [ curl jq ncurses ];
text = ''
# Use bold and gold for the man in black
BOLD=$(tput bold)
GOLD=$(tput setaf 3)
RESET=$(tput sgr0)
echo -e "$\{BOLD\}$\{GOLD\}JOHNNY CASH: THE EARLY YEARS (1954 - 1970)$\{RESET\}"
echo "--------------------------------------------------------"
# Fetching from MusicBrainz API
# Artist ID for Johnny Cash: d43d12a6-91b4-4e73-903b-13c381446f5f
API_URL="https://musicbrainz.org/ws/2/release?artist=d43d12a6-91b4-4e73-903b-13c381446f5f&type=album&fmt=json"
curl -s "$API_URL" | jq -r '.releases
| map(select((."release-events"[0].date | ./[:4] | tonumber) <= 1970))
| sort_by(."release-events"[0].date)
| .[]
| "[\(."release-events"[0].date[:4])] - \( .title )"' \
| uniq
echo "--------------------------------------------------------"
echo "Note: Includes the legendary Folsom and San Quentin live sets."
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment