From 3c92330eaf9ad6bff2d8066dc97440accba7229d Mon Sep 17 00:00:00 2001 From: Emmet Date: Sat, 17 Aug 2024 22:28:47 -0500 Subject: [PATCH] Couldn't get comma to work so I wrote my own! --- profiles/work/configuration.nix | 12 ++++++++++++ user/shell/sh.nix | 1 + 2 files changed, 13 insertions(+) diff --git a/profiles/work/configuration.nix b/profiles/work/configuration.nix index 0cba6904..931765ba 100644 --- a/profiles/work/configuration.nix +++ b/profiles/work/configuration.nix @@ -93,6 +93,18 @@ cryptsetup home-manager wpa_supplicant + (pkgs.writeScriptBin "comma" '' + if [ "$#" = 0 ]; then + echo "usage: comma PKGNAME... [EXECUTABLE]"; + elif [ "$#" = 1 ]; then + nix-shell -p $1 --run $1; + elif [ "$#" = 2 ]; then + nix-shell -p $1 --run $2; + else + echo "error: too many arguments"; + echo "usage: comma PKGNAME... [EXECUTABLE]"; + fi + '') ]; # I use zsh btw diff --git a/user/shell/sh.nix b/user/shell/sh.nix index ea6a861c..4606c865 100644 --- a/user/shell/sh.nix +++ b/user/shell/sh.nix @@ -11,6 +11,7 @@ let neofetch = "disfetch"; fetch = "disfetch"; gitfetch = "onefetch"; + "," = "comma"; }; in {