blob: 298d1af97f4bef857d024a76a8faad47a57db0a9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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' | grep -v os-installation.sh | xargs shellcheck -e SC1090 -e SC1091 -e SC2139
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
'';
};
}
|