fix ls on macos and other nav, passwdless lf

This commit is contained in:
2026-08-31 19:01:49 -05:00
parent 11ab7440fa
commit 7dde6470a4
3 changed files with 82 additions and 62 deletions
+4
View File
@@ -125,6 +125,10 @@
command = "/run/current-system/sw/bin/rsync"; command = "/run/current-system/sw/bin/rsync";
options = ["NOPASSWD"]; options = ["NOPASSWD"];
} }
{
command = "/etc/profiles/per-user/blake/bin/lf";
options = ["NOPASSWD"];
}
]; ];
} }
]; ];
+1 -1
View File
@@ -23,9 +23,9 @@ set ignorecase true
# shortcuts # shortcuts
map gb cd /holocron map gb cd /holocron
map gz cd %{{ [ -d /holocron ] && printf /holocron || printf /media/holocron }}
map gn cd ~/.nix map gn cd ~/.nix
map gc cd ~/.config map gc cd ~/.config
map gv cd /var/lib
# navigation # navigation
map [ half-up map [ half-up
+77 -61
View File
@@ -7,6 +7,7 @@
program = "zsh"; program = "zsh";
cfg = config.dots.${program}; cfg = config.dots.${program};
home_dir = config.home.homeDirectory; home_dir = config.home.homeDirectory;
isDarwin = pkgs.stdenv.isDarwin;
#sec = sops.secrets; #sec = sops.secrets;
in { in {
options.dots.${program} = { options.dots.${program} = {
@@ -23,7 +24,6 @@ in {
programs.${program} = { programs.${program} = {
enable = true; enable = true;
dotDir = "${config.xdg.configHome}/zsh"; dotDir = "${config.xdg.configHome}/zsh";
#dotDir = ".config/zsh";
autocd = true; autocd = true;
enableCompletion = true; enableCompletion = true;
@@ -41,77 +41,93 @@ in {
path = "$XDG_STATE_HOME/zsh/history"; path = "$XDG_STATE_HOME/zsh/history";
}; };
shellAliases = { shellAliases =
# --- zsh --- {
src = "source ${home_dir}/.config/zsh/.zshrc"; # --- zsh ---
src = "source ${home_dir}/.config/zsh/.zshrc";
# --- config editing --- # --- config editing ---
cfl = "nvim /home/blake/.nix/users/blake/dots/core/lf/lfrc"; cfl = "nvim /home/blake/.nix/users/blake/dots/core/lf/lfrc";
cfz = "nvim /home/blake/.nix/users/blake/dots/core/zsh/default.nix"; cfz = "nvim /home/blake/.nix/users/blake/dots/core/zsh/default.nix";
cfv = "sudo lf /var/lib";
# --- navigation --- # --- navigation ---
ls = "ls --color=auto --group-directories-first"; # ls = "ls --color=auto --group-directories-first";
ll = "ls -lh --color=auto --group-directories-first"; # ll = "ls -lh --color=auto --group-directories-first";
la = "ls -Alh --color=auto --group-directories-first"; # la = "ls -Alh --color=auto --group-directories-first";
".." = "cd .."; ".." = "cd ..";
"..." = "cd ../.."; "..." = "cd ../..";
fs = "du -h | sort -h"; fs = "du -h | sort -h";
ds = "du -hs"; ds = "du -hs";
gn = "cd ${home_dir}/.nix"; gn = "cd ${home_dir}/.nix";
woopa = "echo backwhack"; woopa = "echo backwhack";
# --- shortcuts --- # --- shortcuts ---
vswap = "cd ${home_dir}/.local/state/nvim/swap"; vswap = "cd ${home_dir}/.local/state/nvim/swap";
rswap = "rm ${home_dir}/.local/state/nvim/swap/*"; rswap = "rm ${home_dir}/.local/state/nvim/swap/*";
v = "nvim"; v = "nvim";
sv = "sudo nvim"; sv = "sudo nvim";
vim = "nvim"; vim = "nvim";
mime-type = "xdg-mime query filetype"; mime-type = "xdg-mime query filetype";
mime-default = "xdg-mime query default"; mime-default = "xdg-mime query default";
# --- safety --- # --- safety ---
cp = "cp -iv"; cp = "cp -iv";
mv = "mv -iv"; mv = "mv -iv";
rm = "rm -Iv"; rm = "rm -Iv";
# --- colors --- # --- colors ---
grep = "grep --color=auto"; grep = "grep --color=auto";
fgrep = "fgrep --color=auto"; fgrep = "fgrep --color=auto";
egrep = "egrep --color=auto"; egrep = "egrep --color=auto";
# --- scripts --- # --- scripts ---
motd = "sh /etc/motd"; motd = "sh /etc/motd";
rebuild = "sh ${home_dir}/.nix/bin/rebuild"; rebuild = "sh ${home_dir}/.nix/bin/rebuild";
perms = "sudo sh ${home_dir}/.nix/bin/fix-perms"; perms = "sudo sh ${home_dir}/.nix/bin/fix-perms";
# --- git --- # --- git ---
status = "git status"; status = "git status";
add = "git add"; add = "git add";
commit = "git commit"; commit = "git commit";
push = "git push"; push = "git push";
pull = "git pull"; pull = "git pull";
dotfiles = "/usr/bin/git --git-dir=${home_dir}/.dotfiles --work-tree=$HOME"; dotfiles = "/usr/bin/git --git-dir=${home_dir}/.dotfiles --work-tree=$HOME";
dtf = "/usr/bin/git --git-dir=${home_dir}/.dotfiles --work-tree=$HOME"; dtf = "/usr/bin/git --git-dir=${home_dir}/.dotfiles --work-tree=$HOME";
# nix shit # nix shit
sec = "sops ${home_dir}/.nix/secrets/secrets.yaml"; sec = "sops ${home_dir}/.nix/secrets/secrets.yaml";
# zfs # zfs
dfzfs = "zfs list -r -o name,used,usedsnap,usedds"; dfzfs = "zfs list -r -o name,used,usedsnap,usedds";
# --- systemd --- # --- systemd ---
stat = "sudo systemctl status"; stat = "sudo systemctl status";
restart = "sudo systemctl restart"; restart = "sudo systemctl restart";
start = "sudo systemctl start"; start = "sudo systemctl start";
stop = "sudo systemctl stop"; stop = "sudo systemctl stop";
jou = "sudo journalctl -xeu"; jou = "sudo journalctl -xeu";
live = "sudo journalctl -o short-iso -n 50 -fu"; live = "sudo journalctl -o short-iso -n 50 -fu";
# --- system --- # --- system ---
peace = "systemctl poweroff"; peace = "systemctl poweroff";
love = "systemctl reboot"; love = "systemctl reboot";
lock = "loginctl lock-session"; lock = "loginctl lock-session";
}; }
# use GNU core utils ls on macos
// (
if isDarwin
then {
ls = "gls --color=auto --group-directories-first";
ll = "gls -lh --color=auto --group-directories-first";
la = "gls -Alh --color=auto --group-directories-first";
}
else {
ls = "gls --color=auto --group-directories-first";
ll = "gls -lh --color=auto --group-directories-first";
la = "gls -Alh --color=auto --group-directories-first";
}
);
initContent = '' initContent = ''