allow search for multiple maintainers

This commit is contained in:
Callum Leslie 2024-09-09 16:43:09 +01:00
parent f3c284646c
commit 6146544f3c
Signed by: cleslie
GPG key ID: D382C4AFEECEAA90
3 changed files with 4 additions and 4 deletions

View file

@ -1,3 +1,3 @@
# Usage
`nix run github:callumio/nix-search-by-maintainer -- <email to search for> <optional: nixpkgs url to search in>`
`nix run github:callumio/nsbm -- <email to search for> <optional: nixpkgs url to search in>`

View file

@ -1,5 +1,5 @@
{
description = "Flake for nix-search-by-maintainer";
description = "Flake for nsbm";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
@ -27,7 +27,7 @@
}: {
packages = {
default = pkgs.writeShellApplication {
name = "nix-search-by-maintainer";
name = "nsbm";
runtimeInputs = [inputs'.sbomnix.packages.sbomnix pkgs.csvkit pkgs.gum];
text = builtins.readFile ./script.sh;
};

View file

@ -3,5 +3,5 @@
EMAIL="$1"
URL=${2:-"github:NixOS/nixpkgs?ref=master"}
gum spin --spinner dot --title "Querying $URL..." -- nixmeta --flakeref="$URL" -o /tmp/nixmeta.csv
csvsql /tmp/nixmeta.csv --query "select * from nixmeta where meta_maintainers_email==\"$EMAIL\"" | gum table -p
csvsql /tmp/nixmeta.csv --query "select * from nixmeta where meta_maintainers_email LIKE '%$EMAIL%'" | gum table -p
rm /tmp/nixmeta.csv