-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
63 lines (55 loc) · 1.82 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
{
description = "Chez Scheme backend for PureScript";
inputs = {
# we are stuck on 23.05 because clang is broken on macos-x86 until macos 15:
# https://github.com/NixOS/nixpkgs/issues/234710
nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
purescript-overlay.url = "github:thomashoneyman/purescript-overlay";
purescript-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, ... }@inputs:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
overlays = builtins.attrValues self.overlays;
});
in
{
overlays = {
purescript = inputs.purescript-overlay.overlays.default;
};
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
chez = pkgs.chez-racket.overrideAttrs (final: prev: {
postFixup = if pkgs.stdenv.isDarwin then ''
install_name_tool -add_rpath ${pkgs.pcre2.out}/lib $out/bin/scheme
''
else ''
patchelf $out/bin/scheme --add-rpath ${pkgs.pcre2.out}/lib
'';
});
in {
default = pkgs.mkShell {
name = "purescm";
packages = with pkgs; [
purescript-language-server
purs-backend-es
purs-bin.purs-0_15_10
purs-tidy
spago-unstable
nodejs-slim
esbuild
chez
pkg-config
];
};
});
formatter = forAllSystems (system: nixpkgsFor.${system}.nixpkgs-fmt);
};
}