about summary refs log tree commit diff stats
path: root/nix-conf
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-12-02 05:47:55 +0000
committerDavid Morgan <djm_uk@protonmail.com>2022-12-02 05:47:55 +0000
commit8d635cc06cf82d7a18ed4dbf2902db001edcd9e5 (patch)
tree8872c5b389f664054169c9ef52fc289165a08862 /nix-conf
parent1c46d4f55823524aa9dae9501042add24a859289 (diff)
downloaddotfiles-8d635cc06cf82d7a18ed4dbf2902db001edcd9e5.tar.gz
Only use doas for garbage collection if it exists
Diffstat (limited to 'nix-conf')
-rw-r--r--nix-conf/home/includes/zsh.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/nix-conf/home/includes/zsh.nix b/nix-conf/home/includes/zsh.nix
index 1e1b8ab..41c6f7b 100644
--- a/nix-conf/home/includes/zsh.nix
+++ b/nix-conf/home/includes/zsh.nix
@@ -139,10 +139,11 @@
           return 2
         fi
 
+        DOAS=$(command -v doas)
         if  [ $1 -eq 0 ] ; then
-          doas nix-collect-garbage -d
+          $DOAS nix-collect-garbage -d
         else
-          doas nix-collect-garbage --delete-older-than ''${1}d
+          $DOAS nix-collect-garbage --delete-older-than ''${1}d
         fi
         df -h
       }