aboutsummaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-01-01 17:36:26 -0200
committerEuAndreh <eu@euandre.org>2019-01-01 17:36:26 -0200
commitff4b73411dba6097b18266de204587279307be23 (patch)
treee282982c0e55af913c7c2c05c6a00eeb8019b7ef /default.nix
parentStart playing with Dhall to generate yaml. (diff)
downloaddotfiles-ff4b73411dba6097b18266de204587279307be23.tar.gz
dotfiles-ff4b73411dba6097b18266de204587279307be23.tar.xz
Run shellcheck tests in srht builds.
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..8481db4
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,32 @@
+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 = ''
+ find . -type f -name '*.sh' | 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
+ '';
+ };
+}