-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
77 lines (72 loc) · 2.3 KB
/
flake.nix
File metadata and controls
77 lines (72 loc) · 2.3 KB
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
{ 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" "x86_64-darwin" ]
(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 =
[ "console"
"effect"
"prelude"
"flame"
"undefined"
"web-uievents"
"web-html"
"web-cssom-view"
"web-pointerevents"
"debug"
"profunctor-lenses"
"fetch"
"arrays"
"simple-json"
"generate-values"
"numbers"
"exists"
];
dir = ./.;
};
in
{ packages = rec {
default = pkgs.stdenv.mkDerivation {
name = "order-the-magnitudes";
buildInputs = [];
src = ./.;
installPhase = ''
mkdir $out
cp ${bundle} $out/main.js
cp index.html $out/
cp style.css $out/
cp -r data $out/
'';
};
bundle = ps.bundle {};
};
devShells.default =
pkgs.mkShell
{ packages =
with pkgs;
[ entr
nodejs
(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'"
'';
};
}
);
}