diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | paku.json | 15 | ||||
-rwxr-xr-x | scripts/paku | 116 |
5 files changed, 136 insertions, 12 deletions
@@ -1,2 +1,3 @@ /public/ /dependencies.svg +/paku.html @@ -24,12 +24,16 @@ check: dev-check: check clean: - rm -rf public/ dependencies.svg + rm -rf public/ dependencies.svg paku.html dependencies.svg: dependencies.dot dot dependencies.dot -Tsvg > dependencies.svg -public: README.md TODOs.md dependencies.svg +paku.html: paku.json + sh scripts/paku -l + +public: README.md TODOs.md dependencies.svg paku.html sh aux/workflow/public.sh "EuAndreh's package repository" $(NAME) $(MAILING_LIST) - cp EuAndreh.key public/ - cp dependencies.svg public/ + for f in EuAndreh.key dependencies.svg paku.html; do \ + cp $$f public/; \ + done @@ -4,9 +4,9 @@ Personal package repository for a variety of operating systems, mainly for packaging personal projects of mine and make it available for users and packagers. -See the list of packages in [`paku.json`]. +See the list of packages [online]. -[`paku.json`]: https://git.euandreh.xyz/package-repository/tree/paku.json +[online]: https://euandreh.xyz/package-repository/paku.html ## How to add this to different OSes @@ -4,19 +4,22 @@ "name": "remembering", "suffix": "-latest", "version": "5476f9fab45efd3996d50d8b9a1ff4e825d93f44", - "type": "bin" + "type": "bin", + "description": "Add memory to dmenu, fzf and similar tools." }, { "name": "remembering", "suffix": "", "version": "0.2.1", - "type": "bin" + "type": "bin", + "description": "Add memory to dmenu, fzf and similar tools." }, { "name": "autoqemu", "suffix": "-latest", "version": "e676c0baedc09f34fbd07877dc3ab47e9427a221", - "type": "bin" + "type": "bin", + "description": "Installation and setup automation tool for QEMU virtual machines" }, { "name": "fallible", @@ -25,7 +28,8 @@ "type": "lib", "check_inputs": [ "valgrind" - ] + ], + "description": "Fault injection library for stress-testing failure scenarios" }, { "name": "fallible", @@ -34,7 +38,8 @@ "type": "lib", "check_inputs": [ "valgrind" - ] + ], + "description": "Fault injection library for stress-testing failure scenarios" } ] } diff --git a/scripts/paku b/scripts/paku index 3c9e793..939db80 100755 --- a/scripts/paku +++ b/scripts/paku @@ -232,12 +232,123 @@ refresh_packages() { else NEW_VERSION="$(git describe --tags --abbrev=0 | cut -c2-)" fi + DESCRIPTION="$(cat description)" cd - >/dev/null jq -r ".packages[$N].version = \"$NEW_VERSION\"" paku.json | sponge paku.json + jq -r ".packages[$N].description = \"$DESCRIPTION\"" paku.json | sponge paku.json done } -while getopts 'gr' flag; do +report_index() { + cat <<EOF > paku.html +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=" /> + <link rel="icon" type="image/svg+html" href="favicon.svg" /> + <title>Package index</title> + + <style> + ul { + list-style: none; + } + li { + margin-top: 30px; + } + </style> + </head> + <body> + <h1> + Package index + </h1> + <ul> +EOF + + for p in $(jq -r '.packages[] | @base64' < paku.json); do + NAME="$(echo "$p" | base64 --decode | jq -r '.name')" + DESCRIPTION="$(echo "$p" | base64 --decode | jq -r '.description')" + SUFFIX="$(echo "$p" | base64 --decode | jq -r '.suffix')" + if [ -z "$SUFFIX" ]; then + VERSION="$(echo "$p" | base64 --decode | jq -r '.version')" + ID='released' + else + VERSION='latest' + ID='latest' + fi + + cat <<EOF >> paku.html + <li id="$NAME-$ID"> + <details> + <summary><a href="#$NAME-$ID">$NAME</a> ($VERSION) - $DESCRIPTION</summary> + <p> + <a href="https://euandreh.xyz/$NAME/">Homepage</a>. + </p> + + <section> + <h2> + Guix + </h2> + <p> + Add this channel to your Add this channel to your <code>~/.config/guix/channels.scm</code>: + </p> + <pre><code>(cons* + (channel + (name 'xyz-euandreh) + (url "git://euandreh.xyz/package-repository") + (branch "main") + (introduction + (make-channel-introduction + "d749e053e6db365069cb9b2ef47a78b06f9e7361" + (openpgp-fingerprint + "5BDA E9B8 B2F6 C6BC BB0D 6CE5 81F9 0EC3 CD35 6060")))) + %default-channels)</code></pre> + <p> + Now you can create a new Guix environment that includes this package: + </p> + <pre><code>$ guix environment --ad-hoc $NAME$SUFFIX</code></pre> + <p> + Alternatively, you can install it imperatively: + </p> + <pre><code>$ guix install $NAME$SUFFIX</code></pre> + </section> + + <section> + <h2> + Nix + </h2> + <p> + Add the overlay to your <code>/etc/nixox/configuration.nix</code>: + </p> + <pre></code>nixpkgs = { + overlays = [ + (import (fetchTarball { + url = "https://git.euandreh.xyz/package-repository/snapshot/package-repository-main.tar.gz"; + }) { inherit pkgs; }) + ]; +};</code></pre> + <p> + Now you can create a new Nix shell that includes this package: + </p> + <pre><code>$ nix-shell -p $NAME$SUFFIX</code></pre> + <p> + Alternatively, you can install it imperatively: + </p> + <pre><code>$ nix-env -i $NAME$SUFFIX</code></pre> + </section> + </details> + </li> +EOF + done + + cat <<EOF >> paku.html + </ul> + </body> +</html> +EOF +} + +while getopts 'grl' flag; do case "$flag" in g) gen_guix @@ -247,6 +358,9 @@ while getopts 'gr' flag; do r) refresh_packages ;; + l) + report_index + ;; *) printf 'Unrecognized flag "%s".\n' "$flag" >&2 ;; |