diff options
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..c27faff --- /dev/null +++ b/default.nix @@ -0,0 +1,34 @@ +let + pkgs = import <nixpkgs> {}; +in with pkgs; with pkgs.stdenv; rec { + subtasks = rec { + shellcheck = mkDerivation rec { + name = "dotfiles-shellcheck"; + src = ./.; + phases = "unpackPhase buildPhase"; + 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 + touch $out + ''; + }; + }; + test = mkDerivation rec { + name = "dotfiles-test"; + src = ./.; + phases = "unpackPhase buildPhase"; + buildInputs = [ + subtasks.shellcheck + ]; + buildPhase = '' + echo "Ran tests for:" + for d in ${builtins.toString buildInputs}; do + echo " $d" + done + echo "All tests passed!" + touch $out + ''; + }; +} |