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,63 +4,67 @@ 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 = {
|
||||||
set -U fish_greeting ""
|
enable = true;
|
||||||
|
|
||||||
export PATH="$HOME/.deno/bin:$HOME/.cargo/bin:$HOME/.yarn/bin:$HOME/.local/bin:$HOME/.go/bin:$PATH"
|
shellInit = /* fish */ ''
|
||||||
export GOPATH="$HOME/.go"
|
set -U fish_greeting ""
|
||||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
|
||||||
export TERMCMD="kitty --single-instance"
|
|
||||||
export XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS"
|
|
||||||
export DIRENV_LOG_FORMAT=""
|
|
||||||
export PRISMA_SCHEMA_ENGINE_BINARY="${prisma-engines}/bin/schema-engine"
|
|
||||||
export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine"
|
|
||||||
export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node"
|
|
||||||
export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine"
|
|
||||||
export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt"
|
|
||||||
|
|
||||||
# Required to make gpg-agent work in cases like git commit
|
export PATH="$HOME/.deno/bin:$HOME/.cargo/bin:$HOME/.yarn/bin:$HOME/.local/bin:$HOME/.go/bin:$PATH"
|
||||||
export GPG_TTY=(tty)
|
export GOPATH="$HOME/.go"
|
||||||
|
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
||||||
|
export TERMCMD="kitty --single-instance"
|
||||||
|
export XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS"
|
||||||
|
export DIRENV_LOG_FORMAT=""
|
||||||
|
export PRISMA_SCHEMA_ENGINE_BINARY="${prisma-engines}/bin/schema-engine"
|
||||||
|
export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine"
|
||||||
|
export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node"
|
||||||
|
export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine"
|
||||||
|
export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt"
|
||||||
|
|
||||||
# Add color to man pages
|
# Required to make gpg-agent work in cases like git commit
|
||||||
set -x -U LESS_TERMCAP_md (printf "\e[01;31m")
|
export GPG_TTY=(tty)
|
||||||
set -x -U LESS_TERMCAP_me (printf "\e[0m")
|
|
||||||
set -x -U LESS_TERMCAP_se (printf "\e[0m")
|
|
||||||
set -x -U LESS_TERMCAP_so (printf "\e[01;44;30m")
|
|
||||||
set -x -U LESS_TERMCAP_ue (printf "\e[0m")
|
|
||||||
set -x -U LESS_TERMCAP_us (printf "\e[01;32m")
|
|
||||||
set -x -U MANROFFOPT "-c"
|
|
||||||
|
|
||||||
# Always use the default keybindings in fish
|
# Add color to man pages
|
||||||
fish_default_key_bindings
|
set -x -U LESS_TERMCAP_md (printf "\e[01;31m")
|
||||||
|
set -x -U LESS_TERMCAP_me (printf "\e[0m")
|
||||||
|
set -x -U LESS_TERMCAP_se (printf "\e[0m")
|
||||||
|
set -x -U LESS_TERMCAP_so (printf "\e[01;44;30m")
|
||||||
|
set -x -U LESS_TERMCAP_ue (printf "\e[0m")
|
||||||
|
set -x -U LESS_TERMCAP_us (printf "\e[01;32m")
|
||||||
|
set -x -U MANROFFOPT "-c"
|
||||||
|
|
||||||
# Convert unnecessarily large wav files to flac
|
# Always use the default keybindings in fish
|
||||||
function wav2flac
|
fish_default_key_bindings
|
||||||
set ORIGINAL_SIZE (du -hs | cut -f1)
|
|
||||||
|
|
||||||
fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac"
|
# Always use kitty ssh since it's our default terminal
|
||||||
fd -e wav -X trash
|
if string match -qe -- "/dev/pts/" (tty)
|
||||||
|
alias ssh="kitty +kitten ssh"
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
|
||||||
set NEW_SIZE (du -hs | cut -f1)
|
functions = {
|
||||||
|
wav2flac = /* fish */ ''
|
||||||
|
set ORIGINAL_SIZE (du -hs | cut -f1)
|
||||||
|
|
||||||
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
|
fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac"
|
||||||
end
|
fd -e wav -X trash
|
||||||
|
|
||||||
# Convert wav/flac to opus
|
set NEW_SIZE (du -hs | cut -f1)
|
||||||
function opus
|
|
||||||
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"
|
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
|
||||||
fd -e wav -e flac -X rm -I
|
'';
|
||||||
|
|
||||||
set NEW_SIZE (du -hs | cut -f1)
|
opus = /* fish */ ''
|
||||||
|
set ORIGINAL_SIZE (du -hs | cut -f1)
|
||||||
|
|
||||||
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
|
fd -e wav -e flac -x ffmpeg -i "{}" -c:a libopus -b:a 128K -loglevel quiet -stats "{.}.opus"
|
||||||
end
|
fd -e wav -e flac -X rm -I
|
||||||
|
|
||||||
# Always use kitty ssh since it's our default terminal
|
set NEW_SIZE (du -hs | cut -f1)
|
||||||
if string match -qe -- "/dev/pts/" (tty)
|
|
||||||
alias ssh="kitty +kitten ssh"
|
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
|
||||||
end
|
'';
|
||||||
'';
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user