From 9087fabb662718e60243558c90606df617eed511 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Sun, 11 Aug 2024 09:42:01 -0400 Subject: [PATCH] feat: Add disk_usage helper function --- nix/base-system/.zshrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nix/base-system/.zshrc b/nix/base-system/.zshrc index 31a4c7f..9cd6109 100644 --- a/nix/base-system/.zshrc +++ b/nix/base-system/.zshrc @@ -35,3 +35,8 @@ function kill_service_on_port() { kill -9 $p; done } + +function disk_usage() { + local path=${1:-.} + /run/current-system/sw/bin/du --max-depth=1 -h "${path}" 2>/dev/null +}