-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
70 lines (67 loc) · 1.89 KB
/
flake.nix
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
description = "Nix Watch watches over your project's source for changes, and runs Nix commands when they occur.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
nix-watch = pkgs.callPackage ./nix-watch.nix { };
tests = pkgs.callPackage ./tests/default.nix {
inherit (nix-watch) nixWatchBin;
};
in
{
checks = {
nix-watch-bats = pkgs.stdenv.mkDerivation {
name = "nix-watch-bats";
src = "${nix-watch.nixWatchBin}";
buildInputs = with pkgs; [ bats gnused ] ++ nix-watch.devTools;
NIX_WATCH_DRY_RUN = true; # Run nix-watch only once, then exit.
buildPhase = ''
runHook preBuild
${pkgs.bats}/bin/bats ${tests.suite}
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
runHook postInstall
'';
};
};
inherit nix-watch;
packages = {
default = nix-watch.nixWatchBin;
inherit (nix-watch)
fswatch
getopt
coreutils
ncurses
jq
nixWatchBin
;
inherit (tests)
help
exec
ignore
shutdown
postpone
no-restart
shell-args
workdir
test_utils
;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
nil
nixpkgs-fmt
bats
] ++ nix-watch.devTools;
};
formatter = pkgs.nixpkgs-fmt;
});
}