diff --git a/home-manager/modules/bash/bashrc b/home-manager/modules/bash/bashrc index bd843bc..d10db76 100644 --- a/home-manager/modules/bash/bashrc +++ b/home-manager/modules/bash/bashrc @@ -133,3 +133,19 @@ function yaml2nix() nixfmt "${output_file}" } + +function zpool_warning() +{ + if ! ( echo "$@" | grep -v create ) ; then + if [[ "$ZFS_I_REMEMBERED_TO_DISABLE_BLOCK_CLONING" == "1" ]] ; then + echo "I trust you, carry on! But be careful to disable block cloning..." + env zpool "$@" + else + echo "Disable block cloning or you will have a very bad time!" + fi + else + env zpool "$@" + fi +} + +alias zpool="zpool_warning"