Created
April 28, 2024 13:22
-
-
Save Sigmanificient/b1a0136b592f3ac7ba5d253a75a874ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nix-shell | |
#!nix-shell -i bash -p curl jq brotli | |
function parse_unstable_json() { | |
local url="https://channels.nixos.org/nixos-unstable/$1.json.br" | |
echo $(curl -L "$url" | brotli -d --stdout | jq "$2") | |
} | |
pkg_count=$(parse_unstable_json "packages" ".packages | length") | |
opt_count=$(parse_unstable_json "options" "length") | |
echo "{ 'packages': $pkg_count, 'options': $opt_count }" | tr "'" '"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment