diff options
| author | Preston Pan <ret2pop@gmail.com> | 2025-09-12 19:32:06 -0700 |
|---|---|---|
| committer | Preston Pan <ret2pop@gmail.com> | 2025-09-12 19:32:06 -0700 |
| commit | cae70df061d9fc4f33a2da66a21c86eb3eb1fa3b (patch) | |
| tree | baa5edf5af062f3a28647f318165d196b0b7093d /nix/modules/home | |
| parent | c15492d8aa38b7125dc6574c08f6a765aad44fcb (diff) | |
update before new lock file, working on VPS
Diffstat (limited to 'nix/modules/home')
| -rw-r--r-- | nix/modules/home/git.nix | 5 | ||||
| -rw-r--r-- | nix/modules/home/user.nix | 39 | ||||
| -rw-r--r-- | nix/modules/home/zsh.nix | 3 |
3 files changed, 46 insertions, 1 deletions
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"; |
