feat(bud): add bud gc shortcut

This commit is contained in:
Infinidoge 2022-08-17 19:32:16 -04:00
parent 6b7c00e6ef
commit aa387a6f97
2 changed files with 14 additions and 0 deletions

View file

@ -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]";

7
shell/bud/gc.bash Normal file
View file

@ -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 "${@}"