-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
67 lines (61 loc) · 2.14 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
hci-effects.url = "github:hercules-ci/hercules-ci-effects";
flake-lang.url = "github:mlabs-haskell/flake-lang.nix";
prelude-typescript =
{
url = "github:mlabs-haskell/prelude-typescript";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-lang.follows = "flake-lang";
};
};
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; }
{
systems = [ "x86_64-linux" "x86_64-darwin" ];
imports = [
./hercules-ci.nix
./pre-commit.nix
];
perSystem = { config, inputs', system, ... }:
let
tsFlake = inputs.flake-lang.lib.${system}.typescriptFlake
{
name = "plutus-ledger-api";
src = ./.;
npmExtraDependencies = [ inputs'.prelude-typescript.packages.lib ];
devShellHook =
''
${config.devShells.dev-pre-commit.shellHook}
'';
};
in
{
packages = {
# Tarball of the package
tgz = tsFlake.packages.plutus-ledger-api-typescript-tgz;
# Unpacked tarball of the package
lib = tsFlake.packages.plutus-ledger-api-typescript-lib;
# Documentation
docs = tsFlake.packages.plutus-ledger-api-typescript.overrideAttrs (_self: (_super: {
name = "docs";
npmBuildScript = "docs";
installPhase =
''
mv ./docs $out
'';
}));
};
# Provides a development environment
devShells.default = tsFlake.devShells.plutus-ledger-api-typescript;
# Runs `npm test`
checks.default = tsFlake.checks.plutus-ledger-api-typescript-test;
};
};
}