aboutsummaryrefslogtreecommitdiff
path: root/bin/gc
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-02-22 21:34:24 -0300
committerEuAndreh <eu@euandre.org>2023-02-22 21:34:24 -0300
commitaf74b3816c4395ce6391199f997b88fa93c2baa7 (patch)
tree738ed8aa1731a78b21dccbbb5be4ec40c24be726 /bin/gc
parentbin/gc: Do Nix GC too (diff)
downloaddotfiles-af74b3816c4395ce6391199f997b88fa93c2baa7.tar.gz
dotfiles-af74b3816c4395ce6391199f997b88fa93c2baa7.tar.xz
bin/gc: GC Guix for root user
Diffstat (limited to 'bin/gc')
-rwxr-xr-xbin/gc8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/gc b/bin/gc
index cd341ea..32103c5 100755
--- a/bin/gc
+++ b/bin/gc
@@ -79,10 +79,14 @@ disk() {
gc_guix() {
+ if [ ! -e /gnu/ ]; then
+ return
+ fi
+
if [ -e /var/guix/profiles/system ]; then
- pass show "$(hostname)"/andreh | head -n1 |
- sudo -iS sh -c 'guix system delete-generations && guix gc -d'
+ pass show "$(hostname)"/andreh | head -n1 | sudo -iS guix system delete-generations
fi
+ pass show "$(hostname)"/andreh | head -n1 | sudo -iS guix gc -d
guix home delete-generations
guix gc -d
}