diff --git a/home-manager/_mixins/scripts/nixfmt-plus/nixfmt-plus.sh b/home-manager/_mixins/scripts/nixfmt-plus/nixfmt-plus.sh index 33ad26868..1124846b8 100755 --- a/home-manager/_mixins/scripts/nixfmt-plus/nixfmt-plus.sh +++ b/home-manager/_mixins/scripts/nixfmt-plus/nixfmt-plus.sh @@ -1,5 +1,14 @@ #!/usr/bin/env bash +set -eou pipefail -deadnix --edit -statix fix -nixfmt --verify . +if [ $# -eq 0 ]; then + deadnix --edit + statix fix + nixfmt --verify . +else + deadnix --edit "$@" + for target in "$@"; do + statix fix -- "$target" + done + nixfmt --verify "$@" +fi