diff options
author | EuAndreh <eu@euandre.org> | 2019-05-22 02:47:51 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-05-22 02:47:51 -0300 |
commit | 29cccf1438c7891829cf3dd30911cb08ee9ec727 (patch) | |
tree | 1b9393569e001b474370209341697d00c5274793 /default.nix | |
parent | Format default.nix file using nixfmt (diff) | |
download | euandre.org-29cccf1438c7891829cf3dd30911cb08ee9ec727.tar.gz euandre.org-29cccf1438c7891829cf3dd30911cb08ee9ec727.tar.xz |
Add formatNix subtask and use it as buildInput for test derivation
Diffstat (limited to '')
-rw-r--r-- | default.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/default.nix b/default.nix index ae05252..9a8af74 100644 --- a/default.nix +++ b/default.nix @@ -63,6 +63,14 @@ with pkgs.stdenv; rec { touch $out ''; }); + formatNix = baseTask.overrideAttrs (baseAttrs: { + name = "${baseAttrs.name}-nixfmt"; + buildInputs = baseAttrs.buildInputs ++ [nixfmt]; + buildPhase = '' + diff <(nixfmt < default.nix) default.nix + touch $out + ''; + }); docs = baseTask.overrideAttrs (baseAttrs: { name = "${baseAttrs.name}-docs"; buildInputs = [ websiteBuilder pandoc ]; @@ -86,6 +94,7 @@ with pkgs.stdenv; rec { subtasks.perlPodCheck subtasks.batsTest subtasks.perlInternalTest + subtasks.formatNix ]; buildPhase = '' echo "Ran tests for:" |