From b6c2634aded9b07e620e73db86bf9aa58a168e23 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Fri, 20 Sep 2024 00:32:46 -0400 Subject: [PATCH] cleanup fish config --- nix/home-manager/progs/fish.nix | 57 +++++++++++++++++---------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/nix/home-manager/progs/fish.nix b/nix/home-manager/progs/fish.nix index a1c78cb..25e6ac0 100644 --- a/nix/home-manager/progs/fish.nix +++ b/nix/home-manager/progs/fish.nix @@ -1,4 +1,9 @@ { pkgs }: +let + eza = "${pkgs.eza}/bin/eza --color=always --group-directories-first"; + cargo = "${pkgs.cargo}/bin/cargo"; + coreutil = "${pkgs.coreutils}/bin"; +in { enable = true; @@ -7,43 +12,39 @@ set fish_greeting #fixes gnupg password entry - export GPG_TTY=(${pkgs.coreutils}/bin/tty) + export GPG_TTY=(${coreutil}/tty) #pfetch on shell start (disable pkgs because of execution time) PF_INFO="ascii title os host kernel uptime memory editor wm" ${pkgs.pfetch-rs}/bin/pfetch ''; - shellAliases = - let - eza_common = "${pkgs.eza}/bin/eza --color=always --group-directories-first"; - in - { - c = "${pkgs.cargo}/bin/cargo"; - cr = "${pkgs.cargo}/bin/cargo run"; - cb = "${pkgs.cargo}/bin/cargo build"; + shellAliases = { + c = cargo; + cr = "${cargo} run"; + cb = "${cargo} build"; - # I hate the red background - run0 = "run0 --background=\"\""; + # I hate the red background + run0 = "run0 --background=\"\""; - # from DistroTube's dot files: Changing "ls" to "eza" - ls = "${eza_common} -al"; - la = "${eza_common} -a"; - ll = "${eza_common} -l"; - lt = "${eza_common} -aT"; + # from DistroTube's dot files: Changing "ls" to "eza" + ls = "${eza} -al"; + la = "${eza} -a"; + ll = "${eza} -l"; + lt = "${eza} -aT"; - # gets the largest files in a git repo's history - "git-size" = '' - ${pkgs.git}/bin/git rev-list --objects --all | - ${pkgs.git}/bin/git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | - ${pkgs.gnused}/bin/sed -n 's/^blob //p' | - ${pkgs.coreutils}/bin/sort --numeric-sort --key=2 | - ${pkgs.coreutils}/bin/cut -c 1-12,41- | - ${pkgs.coreutils}/bin/numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest''; + # gets the largest files in a git repo's history + "git-size" = '' + ${pkgs.git}/bin/git rev-list --objects --all | + ${pkgs.git}/bin/git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | + ${pkgs.gnused}/bin/sed -n 's/^blob //p' | + ${coreutil}/sort --numeric-sort --key=2 | + ${coreutil}/cut -c 1-12,41- | + ${coreutil}/numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest''; - #aliases for (I think) macos commands - pbcopy = "${pkgs.wl-clipboard}/bin/wl-copy"; - pbpaste = "${pkgs.wl-clipboard}/bin/wl-paste"; - }; + #aliases for (I think) macos commands + pbcopy = "${pkgs.wl-clipboard}/bin/wl-copy"; + pbpaste = "${pkgs.wl-clipboard}/bin/wl-paste"; + }; shellInit = '' fish_add_path ~/.local/bin