2020-10-12 00:22:58 +00:00
|
|
|
#! /usr/bin/env nix-shell
|
2023-01-10 09:35:00 +00:00
|
|
|
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/6616de389ed55fba6eeba60377fc04732d5a207c.tar.gz -i bash -p findutils nixfmt
|
2020-10-12 00:22:58 +00:00
|
|
|
|
|
|
|
CHECK_ARG=
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
-h)
|
|
|
|
echo "$0 [-c]"
|
|
|
|
;;
|
|
|
|
-c)
|
|
|
|
CHECK_ARG=-c
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2021-11-04 16:42:44 +00:00
|
|
|
# The excludes are for files touched by open pull requests and we want
|
|
|
|
# to avoid merge conflicts.
|
2020-10-12 00:22:58 +00:00
|
|
|
find . -name '*.nix' \
|
|
|
|
! -path ./modules/default.nix \
|
|
|
|
! -path ./modules/files.nix \
|
|
|
|
! -path ./modules/home-environment.nix \
|
|
|
|
! -path ./modules/lib/default.nix \
|
|
|
|
! -path ./modules/lib/file-type.nix \
|
|
|
|
! -path ./modules/misc/news.nix \
|
|
|
|
! -path ./modules/programs/bash.nix \
|
|
|
|
! -path ./modules/programs/ssh.nix \
|
|
|
|
! -path ./modules/programs/zsh.nix \
|
|
|
|
! -path ./tests/default.nix \
|
|
|
|
-exec nixfmt $CHECK_ARG {} +
|