diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a99438..1f15d8b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,7 @@ test: script: - nix-build --no-out-link --show-trace tests + +nixpkgs-fmt: + script: + - ./check-fmt diff --git a/check-fmt b/check-fmt new file mode 100755 index 0000000..4c41da4 --- /dev/null +++ b/check-fmt @@ -0,0 +1,10 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash +# +# Just because the nixpkgs-fmt error message is not super readable. Used by +# CI. + +if ! nixpkgs-fmt --check . ; then + echo 'run `nixpkgs-fmt .` to fix it' + exit 1 +fi diff --git a/shell.nix b/shell.nix index 7e13b49..8610a3d 100644 --- a/shell.nix +++ b/shell.nix @@ -6,5 +6,6 @@ in pkgs.mkShell { buildInputs = [ poetry + pkgs.nixpkgs-fmt ]; }