diff options
author | David Morgan <djm_uk@protonmail.com> | 2022-12-02 05:47:55 +0000 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2022-12-02 05:47:55 +0000 |
commit | 8d635cc06cf82d7a18ed4dbf2902db001edcd9e5 (patch) | |
tree | 8872c5b389f664054169c9ef52fc289165a08862 /nix-conf/home/includes/zsh.nix | |
parent | 1c46d4f55823524aa9dae9501042add24a859289 (diff) | |
download | dotfiles-8d635cc06cf82d7a18ed4dbf2902db001edcd9e5.tar.gz |
Only use doas for garbage collection if it exists
Diffstat (limited to 'nix-conf/home/includes/zsh.nix')
-rw-r--r-- | nix-conf/home/includes/zsh.nix | 5 |
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 } |