diff --git a/bin/nix-build-and-cache b/bin/nix-build-and-cache index 7d21428f..b206da66 100755 --- a/bin/nix-build-and-cache +++ b/bin/nix-build-and-cache @@ -5,8 +5,13 @@ set -euo pipefail # The first argument must be the desired installable INSTALLABLE="$1" -# Build the installable and forward any other arguments too -nix build "$@" +# Build the installable and forward any other arguments too. Also, use +# nix-output-monitor instead if it's available. +if command -v nom &> /dev/null; then + nom build "$@" +else + nix build "$@" +fi if [ ! -z ${ATTIC_TOKEN+x} ]; then nix run --inputs-from . attic -- \