From 3ba1083d28596949b8ffcee3843ef8aad2796c02 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 24 Jan 2024 19:42:52 +0300 Subject: [PATCH] Nix : Add cleanup. --- .config/bash/module/Nix.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/bash/module/Nix.sh b/.config/bash/module/Nix.sh index f089b68..699c11e 100644 --- a/.config/bash/module/Nix.sh +++ b/.config/bash/module/Nix.sh @@ -37,3 +37,9 @@ function nix_update() { function nix_upgrade() { nixos-rebuild switch --upgrade } + +# Free up root space. +function nix_clean() { + nix-collect-garbage -d + [[ "${UID}" = 0 ]] && nix-store --gc +}