2020-02-01 19:59:49 +00:00
|
|
|
#! /usr/bin/env nix-shell
|
2021-08-24 19:49:46 +00:00
|
|
|
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/5edf5b60c3d8f82b5fc5e73e822b6f7460584945.tar.gz -i bash -p findutils nixfmt
|
2020-02-01 19:59:49 +00:00
|
|
|
|
|
|
|
CHECK_ARG=
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
-h)
|
|
|
|
echo "$0 [-c]"
|
|
|
|
;;
|
|
|
|
-c)
|
|
|
|
CHECK_ARG=-c
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2021-10-31 09:32:58 +00:00
|
|
|
# The excludes are for files touched by open pull requests and we want
|
|
|
|
# to avoid merge conflicts.
|
2020-02-01 19:59:49 +00:00
|
|
|
find . -name '*.nix' \
|
|
|
|
! -path ./home-manager/home-manager.nix \
|
|
|
|
! -path ./modules/default.nix \
|
|
|
|
! -path ./modules/files.nix \
|
|
|
|
! -path ./modules/home-environment.nix \
|
2021-11-21 16:13:30 +00:00
|
|
|
! -path ./modules/launchd/launchd.nix \
|
2020-02-01 19:59:49 +00:00
|
|
|
! -path ./modules/lib/default.nix \
|
|
|
|
! -path ./modules/lib/file-type.nix \
|
|
|
|
! -path ./modules/manual.nix \
|
|
|
|
! -path ./modules/misc/news.nix \
|
|
|
|
! -path ./modules/programs/bash.nix \
|
|
|
|
! -path ./modules/programs/ssh.nix \
|
|
|
|
! -path ./modules/programs/zsh.nix \
|
|
|
|
! -path ./nix-darwin/default.nix \
|
|
|
|
! -path ./tests/default.nix \
|
|
|
|
-exec nixfmt $CHECK_ARG {} +
|