-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
109 lines (105 loc) · 2.85 KB
/
Copy pathflake.nix
File metadata and controls
109 lines (105 loc) · 2.85 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
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
104
105
106
107
108
109
{
description = "PureScript browser UI scaffold for the wasm32 Plutus evaluator";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
purescript-overlay = {
url = "github:paolino/purescript-overlay/fix/remove-nodePackages";
inputs.nixpkgs.follows = "nixpkgs";
};
mkSpagoDerivation = {
url = "github:jeslie0/mkSpagoDerivation";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
purescript-overlay,
mkSpagoDerivation,
...
}:
let
supportedSystems = [
"x86_64-linux"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
pkgsFor =
system:
import nixpkgs {
inherit system;
overlays = [
purescript-overlay.overlays.default
mkSpagoDerivation.overlays.default
];
};
in
{
packages = forAllSystems (
system:
let
pkgs = pkgsFor system;
nodeModules = pkgs.importNpmLock.buildNodeModules {
npmRoot = ./.;
nodejs = pkgs.nodejs_22;
};
uplcWasm = pkgs.fetchurl {
url = "https://github.com/lambdasistemi/plutus/releases/download/1.67.0.0-wasm32.1/uplc.wasm";
hash = "sha256-CEdzTq23Z7isao4IA9t42w+uI3TYIzNWKYGP8XLFskk=";
};
in
{
default = pkgs.mkSpagoDerivation {
pname = "plutus-browser";
version = "0.1.0";
src = ./.;
spagoYaml = ./spago.yaml;
spagoLock = ./spago.lock;
nativeBuildInputs = [
pkgs.purs
pkgs.spago-unstable
pkgs.esbuild
pkgs.nodejs_22
];
buildPhase = ''
ln -s ${nodeModules}/node_modules node_modules
mkdir -p src/assets dist
cp ${uplcWasm} src/assets/uplc.wasm
npm run build:inside
'';
installPhase = ''
mkdir -p $out
cp -R dist/. $out/
'';
};
}
);
checks = forAllSystems (system: {
build = self.packages.${system}.default;
});
devShells = forAllSystems (
system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell {
buildInputs = [
pkgs.purs
pkgs.spago-unstable
pkgs.purs-tidy-bin.purs-tidy-0_10_0
pkgs.purescript-language-server
pkgs.esbuild
pkgs.nodejs_22
pkgs.just
pkgs.curl
pkgs.python3
pkgs.chromium
];
PLAYWRIGHT_CHROMIUM_EXECUTABLE = "${pkgs.chromium}/bin/chromium";
};
}
);
};
}