From 4f2bf2a2a398197ec12593025aed4ca4e703c74d Mon Sep 17 00:00:00 2001 From: Leon Schumacher Date: Wed, 30 Oct 2024 21:43:19 +0100 Subject: [PATCH] README: add number of packages --- README.md | 3 ++- README.md.in | 2 +- flake.nix | 21 +++++++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 786f96c..a6ce98d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A personal collection of unusual things * substituter: `https://attic.eleonora.gay/default` * public key: `default:3FYh8sZV8gWa7Jc5jlP7gZFK7pt3kaHRiV70ySaQ42g=` -## Packages +## 39 Packages | Name | Description | Homepage | |------|-------------|----------| @@ -48,3 +48,4 @@ A personal collection of unusual things |`vencloud`|Vencord API|https://github.com/Vencord/Vencloud| |`vwifi`|Simulator of WiFi (802.11) interfaces to communicate between several Virtual Machines|https://github.com/Raizo62/vwifi| |`wayland-shell`|Small-scale replacement of the GNOME Shell|https://github.com/nilsherzig/wayland-shell| + diff --git a/README.md.in b/README.md.in index da8d3d1..b519f82 100644 --- a/README.md.in +++ b/README.md.in @@ -5,7 +5,7 @@ A personal collection of unusual things * substituter: `https://attic.eleonora.gay/default` * public key: `default:3FYh8sZV8gWa7Jc5jlP7gZFK7pt3kaHRiV70ySaQ42g=` -## Packages +## @NUM@ Packages | Name | Description | Homepage | |------|-------------|----------| diff --git a/flake.nix b/flake.nix index ed64296..5e5cc28 100644 --- a/flake.nix +++ b/flake.nix @@ -105,12 +105,21 @@ readme = pipe self.packages.${pkgs.system} [ (mapAttrsToList (name: p: "|`${name}`|${p.meta.description or ""}|${p.meta.homepage or ""}|")) - (builtins.concatStringsSep "\n") - (s: pkgs.writeText "readme" - (builtins.readFile ./README.md.in + s + "\n")) - (s: pkgs.writeShellScriptBin "readme" '' - install -m644 ${s} README.md - '') + (x: pipe x [ + (builtins.concatStringsSep "\n") + (s: pipe ./README.md.in [ + builtins.readFile + (builtins.replaceStrings + [ "@NUM@" ] + [ (toString (builtins.length x)) ]) + (x: x + s + "\n") + ]) + (s: pkgs.writeShellScriptBin "readme" '' + cat <<\EOF > README.md + ${s} + EOF + '') + ]) ]; matrix = pkgs.writeShellApplication {