-
Notifications
You must be signed in to change notification settings - Fork 7
/
flake.nix
52 lines (43 loc) · 1.46 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
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem (system:
let pkgs = inputs.nixpkgs.legacyPackages.${system};
mkCommand = name: command: inputs.flake-utils.lib.mkApp {
drv = pkgs.writeShellApplication {
inherit name;
text = command;
runtimeInputs = tools;
};
};
tools = with pkgs; [
bazel_5
entr
esbuild
ghcid
graphviz
haskellPackages.hasktags
jq
nodejs
ormolu
purescript
spago
];
in {
devShells.default = pkgs.mkShell { nativeBuildInputs = tools; };
apps.build = mkCommand "build"
"bazel build //backend:skyscope --host_platform=//backend:regular_executable";
apps.ghcid = mkCommand "ghcid"
"LC_ALL=C.UTF-8 ghcid --allow-eval --command bazel run //backend:skyscope@repl";
apps.purs = mkCommand "purs"
"cd frontend; echo src/Main.purs | entr bash -c 'clear; spago bundle-app'";
apps.format = mkCommand "format" ''
# shellcheck disable=SC2046
ormolu --mode inplace $(find . -name '*.hs')
'';
apps.tags = mkCommand "tags" ''
hasktags -c -S '[".hs",".purs"]' .
'';
});
}