fish: Convert to home-manager module

The home-manager module seems to be fixed now and doesn't cause an
abnormal startup time anymore.
This commit is contained in:
Donovan Glover 2024-04-06 19:37:20 -04:00
parent 006a3592e6
commit 8e4c9981ea
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -4,7 +4,10 @@ let
inherit (pkgs) gsettings-desktop-schemas prisma-engines gtk3; inherit (pkgs) gsettings-desktop-schemas prisma-engines gtk3;
in in
{ {
xdg.configFile."fish/config.fish".text = /* fish */ '' programs.fish = {
enable = true;
shellInit = /* fish */ ''
set -U fish_greeting "" set -U fish_greeting ""
export PATH="$HOME/.deno/bin:$HOME/.cargo/bin:$HOME/.yarn/bin:$HOME/.local/bin:$HOME/.go/bin:$PATH" export PATH="$HOME/.deno/bin:$HOME/.cargo/bin:$HOME/.yarn/bin:$HOME/.local/bin:$HOME/.go/bin:$PATH"
@ -34,8 +37,14 @@ in
# Always use the default keybindings in fish # Always use the default keybindings in fish
fish_default_key_bindings fish_default_key_bindings
# Convert unnecessarily large wav files to flac # Always use kitty ssh since it's our default terminal
function wav2flac if string match -qe -- "/dev/pts/" (tty)
alias ssh="kitty +kitten ssh"
end
'';
functions = {
wav2flac = /* fish */ ''
set ORIGINAL_SIZE (du -hs | cut -f1) set ORIGINAL_SIZE (du -hs | cut -f1)
fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac" fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac"
@ -44,10 +53,9 @@ in
set NEW_SIZE (du -hs | cut -f1) set NEW_SIZE (du -hs | cut -f1)
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE" echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
end '';
# Convert wav/flac to opus opus = /* fish */ ''
function opus
set ORIGINAL_SIZE (du -hs | cut -f1) set ORIGINAL_SIZE (du -hs | cut -f1)
fd -e wav -e flac -x ffmpeg -i "{}" -c:a libopus -b:a 128K -loglevel quiet -stats "{.}.opus" fd -e wav -e flac -x ffmpeg -i "{}" -c:a libopus -b:a 128K -loglevel quiet -stats "{.}.opus"
@ -56,11 +64,7 @@ in
set NEW_SIZE (du -hs | cut -f1) set NEW_SIZE (du -hs | cut -f1)
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE" echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
end
# Always use kitty ssh since it's our default terminal
if string match -qe -- "/dev/pts/" (tty)
alias ssh="kitty +kitten ssh"
end
''; '';
};
};
} }