mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 08:14:00 +01:00
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:
parent
006a3592e6
commit
8e4c9981ea
@ -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
|
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user