Fish formatting and ls aliases

This commit is contained in:
Daniel Flanagan 2024-06-13 18:46:59 -05:00
parent c9787b39f8
commit 498caa4578
3 changed files with 26 additions and 19 deletions

View file

@ -47,13 +47,14 @@
}; };
shellAbbrs = {}; shellAbbrs = {};
shellAliases = { shellAliases = {
l = "br";
ls = "eza --group-directories-first --classify"; ls = "eza --group-directories-first --classify";
la = "eza -la --group-directories-first --classify"; l = "ls";
lA = "eza -la --all --group-directories-first --classify"; ll = "ls --long --group";
tree = "eza --tree --level=3"; la = "ll --all";
lt = "eza -l --sort=modified"; lA = "la --all"; # --all twice to show . and ..
lat = "eza -la --sort=modified"; tree = "ls --tree --level=3";
lt = "ll --sort=modified";
lat = "la --sort=modified";
lc = "lt --sort=accessed"; lc = "lt --sort=accessed";
lT = "lt --reverse"; lT = "lt --reverse";
lC = "lc --reverse"; lC = "lc --reverse";

View file

@ -1,10 +1,10 @@
# paths # paths
if not set --query NICE_HOME if not set --query NICE_HOME
set --export --universal NICE_HOME $HOME set --export --universal NICE_HOME $HOME
# if HOME ends with a dir called .home, assume that NICE_HOME is HOME's parent dir # if HOME ends with a dir called .home, assume that NICE_HOME is HOME's parent dir
test (basename $HOME) = .home \ test (basename $HOME) = .home \
&& set --export --universal NICE_HOME (realpath $HOME/..) && set --export --universal NICE_HOME (realpath $HOME/..)
end end
set --export --universal XDG_CONFIG_HOME $HOME/.config set --export --universal XDG_CONFIG_HOME $HOME/.config
@ -38,8 +38,8 @@ set --export --universal BROWSER firefox
set --export --universal SOPS_AGE_KEY_FILE "$XDG_CONFIG_HOME/sops/age/keys.txt" set --export --universal SOPS_AGE_KEY_FILE "$XDG_CONFIG_HOME/sops/age/keys.txt"
if has_command skim if has_command skim
set --export --universal SKIM_ALT_C_COMMAND "fd --hidden --type directory" set --export --universal SKIM_ALT_C_COMMAND "fd --hidden --type directory"
set --export --universal SKIM_CTRL_T_COMMAND "fd --hidden" set --export --universal SKIM_CTRL_T_COMMAND "fd --hidden"
end end
# colors # colors
@ -67,17 +67,20 @@ set -U fish_pager_color_progress white\x1e\x2d\x2dbackground\x3d333 # status ind
# set -U fish_pager_color_secondary \x2d\x2dbackground\x3d181818 # alternating rows # set -U fish_pager_color_secondary \x2d\x2dbackground\x3d181818 # alternating rows
if test -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish' if test -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish'
source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish' source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish'
end end
function has_command --wraps=command --description "Exits non-zero if the given command cannot be found" function has_command --wraps=command --description "Exits non-zero if the given command cannot be found"
command --quiet --search $argv[1] command --quiet --search $argv[1]
end end
if has_command rtx if has_command rtx
rtx activate fish | source rtx activate fish | source
end end
for dir in ~/.cargo/bin ~/.nimble/bin ~/.local/bin /opt/homebrew/bin for dir in ~/.cargo/bin ~/.nimble/bin ~/.local/bin /opt/homebrew/bin
test -d $dir && fish_add_path $dir test -d $dir && fish_add_path $dir
end end
# don't let other users read my files by default
umask 077

View file

@ -149,11 +149,14 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
networking = { networking = {
firewall = { firewall = let
terraria = 7777;
stardew-valley = 24642;
in {
enable = true; enable = true;
allowPing = true; allowPing = true;
allowedTCPPorts = [22 7777]; allowedTCPPorts = [22 terraria stardew-valley];
allowedUDPPorts = []; allowedUDPPorts = [terraria stardew-valley];
}; };
}; };