home/fish: add getmnter function
This commit is contained in:
parent
2141256716
commit
1403595ae1
1 changed files with 13 additions and 5 deletions
|
@ -58,14 +58,22 @@
|
||||||
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb
|
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.fish.functions = {
|
programs.fish.functions = let
|
||||||
"pb" = let
|
jq = lib.getExe pkgs.jq;
|
||||||
jq = lib.getExe pkgs.jq;
|
nix = lib.getExe pkgs.nix;
|
||||||
curl = lib.getExe pkgs.curl;
|
curl = lib.getExe pkgs.curl;
|
||||||
in ''
|
awk = lib.getExe pkgs.gawk;
|
||||||
|
in {
|
||||||
|
"pb" = ''
|
||||||
${jq} -Rns '{text: inputs}' | \
|
${jq} -Rns '{text: inputs}' | \
|
||||||
${curl} -s -H 'Content-Type: application/json' --data-binary @- https://pb.ny4.dev | \
|
${curl} -s -H 'Content-Type: application/json' --data-binary @- https://pb.ny4.dev | \
|
||||||
${jq} -r '. | "https://pb.ny4.dev\(.path)"'
|
${jq} -r '. | "https://pb.ny4.dev\(.path)"'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
"getmnter" = ''
|
||||||
|
${nix} eval nixpkgs#{$argv}.meta.maintainers --json | \
|
||||||
|
${jq} '.[].github' -r | \
|
||||||
|
${awk} '{ print "@" $1 }'
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue