-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da86490
commit 768c868
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#! /usr/bin/env bash | ||
IT=. | ||
PACKAGES=$(nix flake show --json $IT | jq -r '.packages."x86_64-linux" | keys[] | select(endswith("toplevel") | not)') | ||
(for PACKAGE in $PACKAGES | ||
do | ||
jq -n \ | ||
--arg name $PACKAGE \ | ||
--slurpfile meta <(nix eval --json .#${PACKAGE}.meta) \ | ||
--slurpfile drv <(nix derivation show .#${PACKAGE}) \ | ||
'($drv[0] | to_entries | .[] | .value | { Name: "[`\($name)`](\($meta[0].position | ltrimstr("/nix/store/") | .[index("/"):index(":")]))", Website: ($meta[0].homepage | if . then "[link](\($meta[0].homepage))" else "" end), Version: .env.version }) * | ||
($meta[0] | { | ||
Description: (.description // ""), | ||
License: (.license | if type == "array" then map(.spdxId) else (.spdxId // "") end), | ||
})' | ||
done) | jq -s '.' | tv --style markdown |