From aa387a6f97f7ea9f473bb9982d44e9c1ede17857 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Wed, 17 Aug 2022 19:32:16 -0400 Subject: [PATCH] feat(bud): add bud gc shortcut --- shell/bud/default.nix | 7 +++++++ shell/bud/gc.bash | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 shell/bud/gc.bash 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 "${@}"