diff --git a/shell/bud/default.nix b/shell/bud/default.nix index 4b181e0..5226714 100644 --- a/shell/bud/default.nix +++ b/shell/bud/default.nix @@ -9,6 +9,13 @@ script = ./b.bash; }; + gc = { + writer = budUtils.writeBashWithPaths [ nixUnstable ]; + synopsis = "gc [-d]"; + help = "Shortcut for nix-collect-garbage for both the user and root"; + script = ./gc.bash; + }; + install-doom = { writer = budUtils.writeBashWithPaths [ git coreutils emacs ]; synopsis = "install-doom [ARGS]"; diff --git a/shell/bud/gc.bash b/shell/bud/gc.bash new file mode 100644 index 0000000..286fd64 --- /dev/null +++ b/shell/bud/gc.bash @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if [ -x /run/wrappers/bin/sudo ]; then + export PATH=/run/wrappers/bin:$PATH +fi +nix-collect-garbage "${@}" +sudo nix-collect-garbage "${@}"