-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
flake.nix
72 lines (65 loc) · 2.06 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
# WARNING:
# This is still a work in progress and not yet fully functional.
{
description = "Transity";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
purescript-overlay = {
url = "github:thomashoneyman/purescript-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
config = { };
# TODO: PureScript deps are currently still installed via npm
# overlays = builtins.attrValues self.overlays;
});
in {
# TODO: PureScript deps are currently still installed via npm
# overlays = {
# purescript = inputs.purescript-overlay.overlays.default;
# };
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system}; in {
default = pkgs.buildNpmPackage {
name = "transity";
buildInputs = [ nixpkgsFor.${system}.nodejs_20 ];
src = ./.;
npmDepsHash = "sha256-yBjzdVe2nNGT3ACXhz/ZsOCm7d4ELvHGed9ZD410LAY=";
npmBuild = "make bundle";
installPhase = ''
mkdir $out
cp index.js $out
'';
};
});
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system}; in {
default = pkgs.mkShell {
name = "transity";
# TODO: This somehow makes it use nodejs_18
# inputsFrom = builtins.attrValues self.packages.${system};
buildInputs = with pkgs; [
bun
nodejs_20
watchexec
# TODO: PureScript deps are currently still installed via npm
# purs
# purs-backend-es
# purs-tidy-bin.purs-tidy-0_10_1
# spago-unstable
];
};
});
};
}