aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--default.nix23
-rw-r--r--spelling/en_US-dict.txt7
2 files changed, 29 insertions, 1 deletions
diff --git a/default.nix b/default.nix
index 9a8af74..a5d6f4e 100644
--- a/default.nix
+++ b/default.nix
@@ -67,7 +67,26 @@ with pkgs.stdenv; rec {
name = "${baseAttrs.name}-nixfmt";
buildInputs = baseAttrs.buildInputs ++ [nixfmt];
buildPhase = ''
- diff <(nixfmt < default.nix) default.nix
+ diff <(nixfmt < default.nix) default.nix || {
+ echo "The default.nix is unformatted. To fix it, run:"
+ echo " nixfmt default.nix"
+ exit 1
+ }
+ touch $out
+ '';
+ });
+ hunspellCheck = baseTask.overrideAttrs (baseAttrs: {
+ name = "${baseAttrs.name}-hunspell";
+ buildInputs = baseAttrs.buildInputs
+ ++ [(hunspellWithDicts (with hunspellDicts; [en-us]))];
+ buildPhase = ''
+ DICT="spelling/en_US-dict.txt"
+ diff <(sort --ignore-case $DICT) $DICT || {
+ echo "The $DICT dictionary is unsorted. To fix it, run:"
+ echo " sort $DICT | sort --ignore-case | sponge $DICT"
+ exit 1
+ }
+
touch $out
'';
});
@@ -95,6 +114,7 @@ with pkgs.stdenv; rec {
subtasks.batsTest
subtasks.perlInternalTest
subtasks.formatNix
+ subtasks.hunspellCheck
];
buildPhase = ''
echo "Ran tests for:"
@@ -111,6 +131,7 @@ with pkgs.stdenv; rec {
websiteBuilder
(pkgs.haskellPackages.ghcWithPackages (p: with p; [hakyll]))
nixfmt
+ (hunspellWithDicts (with hunspellDicts; [en-us]))
];
};
publishScript = pkgs.writeShellScriptBin "publish.sh" ''
diff --git a/spelling/en_US-dict.txt b/spelling/en_US-dict.txt
new file mode 100644
index 0000000..bb84c0c
--- /dev/null
+++ b/spelling/en_US-dict.txt
@@ -0,0 +1,7 @@
+81F90EC3CD356060
+EuAndreh
+GPLv3
+guix
+GuixSD
+libre
+NixOS