mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-12-15 19:30:51 +01:00
Nixify fish config
Note that the home manager module isn't used here since the resulting config.fish made fish noticeably slower on startup.
This commit is contained in:
parent
dac973d4a9
commit
0038165390
@ -58,6 +58,15 @@
|
||||
};
|
||||
};
|
||||
|
||||
environment.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
GIT_DISCOVERY_ACROSS_FILESYSTEM = "1";
|
||||
FZF_DEFAULT_COMMAND = "rg --files --no-ignore --hidden --follow --glob \"!.git/*\"";
|
||||
FZF_DEFAULT_OPTS = "--height 40% --reverse --border --color=16";
|
||||
NODE_OPTIONS = "--max_old_space_size=16384";
|
||||
};
|
||||
|
||||
services.vnstat.enable = true;
|
||||
services.tumbler.enable = true;
|
||||
security.rtkit.enable = true;
|
||||
@ -72,6 +81,12 @@
|
||||
programs.fish.enable = true;
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
environment.shells = with pkgs; [ fish ];
|
||||
programs.fish.shellAliases = {
|
||||
ls = "exa --group-directories-first -I 'lost+found'";
|
||||
tree = "exa --group-directories-first --all --long --tree -I 'node_modules|.git|public|lost+found'";
|
||||
mv = "mv -i";
|
||||
rg = "rg --max-columns=2000";
|
||||
};
|
||||
programs.fish.shellAbbrs = {
|
||||
g = "git";
|
||||
ga = "git add";
|
||||
@ -170,8 +185,6 @@
|
||||
};
|
||||
|
||||
character = {
|
||||
#success_symbol = "[➤](red)[➤](green)[➤](blue)";
|
||||
#error_symbol = "[➤](cyan)[➤](purple)[➤](yellow)";
|
||||
success_symbol = "[>](red)[>](green)[>](blue)";
|
||||
error_symbol = "[>](cyan)[>](purple)[>](yellow)";
|
||||
vicmd_symbol = "[<](bold green)";
|
||||
|
@ -49,6 +49,63 @@
|
||||
set preview_images true
|
||||
set preview_images_method kitty
|
||||
'';
|
||||
xdg.configFile."fish/config.fish".text = ''
|
||||
set -U fish_greeting ""
|
||||
|
||||
export PATH="$HOME/.deno/bin:$HOME/.cargo/bin:$HOME/.yarn/bin:$HOME/.local/bin:$HOME/.go/bin:$PATH"
|
||||
export GOPATH="$HOME/.go"
|
||||
export SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/ssh-agent.socket"
|
||||
export TERMCMD="kitty --single-instance"
|
||||
|
||||
# Required to make gpg-agent work in cases like git commit
|
||||
export GPG_TTY=(tty)
|
||||
|
||||
# Add color to man pages
|
||||
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")
|
||||
|
||||
# Always use the default keybindings in fish
|
||||
fish_default_key_bindings
|
||||
|
||||
# Convert unnecessarily large wav files to flac
|
||||
function wav2flac
|
||||
set ORIGINAL_SIZE (du -hs | cut -f1)
|
||||
|
||||
fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac"
|
||||
fd -e wav -X trash
|
||||
|
||||
set NEW_SIZE (du -hs | cut -f1)
|
||||
|
||||
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
|
||||
end
|
||||
|
||||
# Convert wav/flac to opus
|
||||
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"
|
||||
fd -e wav -e flac -X rm -I
|
||||
|
||||
set NEW_SIZE (du -hs | cut -f1)
|
||||
|
||||
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
|
||||
|
||||
# if status is-login
|
||||
# if test -z "$DISPLAY" -a "$XDG_VTNR" = 1
|
||||
# exec Hyprland
|
||||
# end
|
||||
# end
|
||||
'';
|
||||
gtk = {
|
||||
enable = true;
|
||||
cursorTheme = {
|
||||
|
Loading…
Reference in New Issue
Block a user