aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-05-30 22:47:31 -0300
committerEuAndreh <eu@euandre.org>2019-05-30 22:47:31 -0300
commit657c872b0c3dc40e5abef38812f285b69509c236 (patch)
tree5e26c348937e30a28fcac1d910d96770577c387e /nixos
parentFormat all Nix code with nixfmt (diff)
downloaddotfiles-657c872b0c3dc40e5abef38812f285b69509c236.tar.gz
dotfiles-657c872b0c3dc40e5abef38812f285b69509c236.tar.xz
Move shellCheck derivation to utils.nix
Diffstat (limited to 'nixos')
-rw-r--r--nixos/utils.nix7
1 files changed, 3 insertions, 4 deletions
diff --git a/nixos/utils.nix b/nixos/utils.nix
index f809dd9..30110a4 100644
--- a/nixos/utils.nix
+++ b/nixos/utils.nix
@@ -14,13 +14,12 @@ in rec {
exit 1
'';
};
- shellcheck = baseTask.overrideAttrs (baseAttrs: {
+ shellcheck = ignoredFindPattern:
+ baseTask.overrideAttrs (baseAttrs: {
name = "${baseAttrs.name}-shellcheck";
buildInputs = baseAttrs.buildInputs ++ [ pkgs.shellcheck ];
buildPhase = ''
- export SHELLCHECK_OPTS="-e SC1090 -e SC1091 -e SC2139"
- ignored='(encrypted|os-installation.sh|notmuch-post.sh)'
- find . -type f -name '*.sh' | grep -E -v $ignored | xargs shellcheck
+ find . -type f \( -name '*.sh' -and -regextype egrep ! -regex '${ignoredFindPattern}' \) -print0 | xargs -0 shellcheck
touch $out
'';
});