From cae70df061d9fc4f33a2da66a21c86eb3eb1fa3b Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Fri, 12 Sep 2025 19:32:06 -0700 Subject: update before new lock file, working on VPS --- nix/modules/home/git.nix | 5 ++++- nix/modules/home/user.nix | 39 +++++++++++++++++++++++++++++++++++++++ nix/modules/home/zsh.nix | 3 +++ 3 files changed, 46 insertions(+), 1 deletion(-) (limited to 'nix/modules/home') diff --git a/nix/modules/home/git.nix b/nix/modules/home/git.nix index 9c15aac..0e6e66c 100644 --- a/nix/modules/home/git.nix +++ b/nix/modules/home/git.nix @@ -14,10 +14,13 @@ }; aliases = { + pl = "pull"; + ps = "push"; co = "checkout"; c = "commit"; a = "add"; - s = "switch"; + st = "status"; + sw = "switch"; b = "branch"; }; }; diff --git a/nix/modules/home/user.nix b/nix/modules/home/user.nix index d0cad9a..24b61da 100644 --- a/nix/modules/home/user.nix +++ b/nix/modules/home/user.nix @@ -29,6 +29,7 @@ mupdf zathura + fzf # passwords age sops @@ -64,6 +65,44 @@ pfetch libnotify htop + + (pkgs.writeShellScriptBin "help" + '' +#!/usr/bin/env sh +# Portable, colored, nicely aligned alias list + +# Generate uncolored alias pairs +aliases=$(cat <<'EOF' +${let aliases = config.programs.zsh.shellAliases; + in lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: + "${name} -> ${value}" + ) aliases)} +EOF + ) + +# Align and color using awk +echo "$aliases" | awk ' +BEGIN { + GREEN="\033[0;32m"; + YELLOW="\033[0;33m"; + RESET="\033[0m"; + maxlen=0; + } +{ + # Split line on " -> " + split($0, parts, / -> /); + name[NR]=parts[1]; + cmd[NR]=parts[2]; + if(length(parts[1])>maxlen) maxlen=length(parts[1]); +} +END { + for(i=1;i<=NR;i++) { + # printf with fixed width for alias name + printf "%s%-*s%s -> %s%s%s\n", GREEN, maxlen, name[i], RESET, YELLOW, cmd[i], RESET; + } +}' +'') + (writeShellScriptBin "remote-build" '' #!/bin/bash diff --git a/nix/modules/home/zsh.nix b/nix/modules/home/zsh.nix index e12a2d8..cb4f1b0 100644 --- a/nix/modules/home/zsh.nix +++ b/nix/modules/home/zsh.nix @@ -21,6 +21,9 @@ }; shellAliases = { + se = "sops edit"; + f = "vim $(fzf)"; + e = "cd $(find . -type d -print | fzf)"; c = "clear"; g = "git"; v = "vim"; -- cgit v1.3