From af74b3816c4395ce6391199f997b88fa93c2baa7 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 22 Feb 2023 21:34:24 -0300 Subject: bin/gc: GC Guix for root user --- bin/gc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin/gc') 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 } -- cgit v1.2.3