-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
103 lines (95 loc) · 2.68 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
ps-tools.follows = "purs-nix/ps-tools";
purs-nix.url = "github:purs-nix/purs-nix/ps-0.15";
utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, utils, ... }@inputs:
utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
ps-tools = inputs.ps-tools.legacyPackages.${system};
purs-nix = inputs.purs-nix { inherit system; };
ps = purs-nix.purs {
dependencies = [
"aff"
"affjax"
"affjax-web"
"argonaut-core"
"arrays"
"bifunctors"
"codec"
"codec-argonaut"
"datetime"
"debug"
"dom-indexed"
"effect"
"either"
"enums"
"foldable-traversable"
"formatters"
"halogen"
"halogen-formless"
"halogen-store"
"http-methods"
"lists"
"maybe"
"newtype"
"now"
"ordered-collections"
"parallel"
"precise-datetime"
"prelude"
"profunctor"
"profunctor-lenses"
"remotedata"
"routing"
"routing-duplex"
"safe-coerce"
"slug"
"strings"
"transformers"
"tuples"
"typelevel-prelude"
"web-events"
"web-html"
"web-storage"
"web-uievents"
];
dir = ./.;
};
bundle = pkgs.writeShellApplication {
name = "bundle-clean-as-app";
runtimeInputs = [ pkgs.nodejs ];
text = "npm run bundle";
};
serve = pkgs.writeShellApplication {
name = "serve-clean-as-app";
runtimeInputs = [ pkgs.simple-http-server ];
text =
"simple-http-server --ip 127.0.0.1 -p 8080 --nocache -i -- dist";
};
in {
apps = {
"bundle" = utils.lib.mkApp { drv = bundle; };
"serve" = utils.lib.mkApp { drv = serve; };
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
entr
nodejs
nodePackages.purs-tidy
(ps.command { })
ps-tools.for-0_15.purescript-language-server
purs-nix.esbuild
purs-nix.purescript
simple-http-server
];
shellHook = ''
alias watch="find src | entr -s 'echo bundling; purs-nix bundle'"
'';
};
formatter = pkgs.nixfmt;
});
}