feat(porgrams): add nix-edit

This commit is contained in:
Moritz Böhme 2023-05-31 15:51:50 +02:00
parent 57f2094c44
commit 888b3246a7
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
3 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
input=$(
echo ":lf nixpkgs"
echo "pkgs = legacyPackages.\${builtins.currentSystem}"
echo ":doc $1"
echo ":e $1"
)
echo "$input" | nix repl --quiet 2> >(grep -v "ioctl" |
grep -v "^error: value does not have documentation$" |
grep -vP "error: .* has no source location information" |
grep -vP "Welcome to Nix \d+\.\d+\.\d+\." |
grep -vP "Added \d+ variables." |
grep -v -e '^[[:space:]]*$'
)