aboutsummaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-05-22 02:47:51 -0300
committerEuAndreh <eu@euandre.org>2019-05-22 02:47:51 -0300
commit29cccf1438c7891829cf3dd30911cb08ee9ec727 (patch)
tree1b9393569e001b474370209341697d00c5274793 /default.nix
parentFormat default.nix file using nixfmt (diff)
downloadeuandre.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.nix9
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:"