flake/home/applications/fish/default.nix

45 lines
951 B
Nix
Raw Normal View History

2024-08-27 21:44:22 +00:00
{ lib, pkgs, ... }:
{
2023-11-05 09:21:37 +00:00
programs.fish = {
enable = true;
2024-08-27 21:44:22 +00:00
2023-11-05 09:21:37 +00:00
interactiveShellInit = ''
set fish_greeting
'';
2024-08-27 21:44:22 +00:00
2023-11-05 09:21:37 +00:00
plugins = [
{
name = "autopair";
2023-12-02 10:42:59 +00:00
inherit (pkgs.fishPlugins.autopair) src;
2023-11-05 09:21:37 +00:00
}
{
name = "done";
2023-12-02 10:42:59 +00:00
inherit (pkgs.fishPlugins.done) src;
2023-11-05 09:21:37 +00:00
}
{
name = "puffer";
2023-12-02 10:42:59 +00:00
inherit (pkgs.fishPlugins.puffer) src;
2023-11-05 09:21:37 +00:00
}
];
2024-08-27 21:44:22 +00:00
functions =
let
jq = lib.getExe pkgs.jq;
nix = lib.getExe pkgs.nix;
curl = lib.getExe pkgs.curl;
in
{
"pb" = ''
${jq} -Rns '{text: inputs}' | \
${curl} -s -H 'Content-Type: application/json' --data-binary @- https://pb.ny4.dev | \
${jq} -r '. | "https://pb.ny4.dev\(.path)"'
'';
"getmnter" = ''
${nix} eval nixpkgs#{$argv}.meta.maintainers --json | \
${jq} '.[].github | "@" + .' -r
'';
};
2023-11-05 09:21:37 +00:00
};
}