-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
60 lines (53 loc) · 1.83 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
{
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";
};
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 = { system, config, ... }:
let
tsFlake = inputs.flake-lang.lib.${system}.typescriptFlake
{
name = "prelude";
src = ./.;
npmExtraDependencies = [ ];
devShellHook =
''
${config.devShells.dev-pre-commit.shellHook}
'';
};
in
{
packages = {
# Tarball of the package
tgz = tsFlake.packages.prelude-typescript-tgz;
# Unpacked tarball of the package
lib = tsFlake.packages.prelude-typescript-lib;
# Documentation
docs = tsFlake.packages.prelude-typescript.overrideAttrs (_self: (_super: {
name = "docs";
npmBuildScript = "docs";
installPhase =
''
mv ./docs $out
'';
}));
};
# Provides a development environment
devShells.default = tsFlake.devShells.prelude-typescript;
# Runs `npm test`
checks.default = tsFlake.checks.prelude-typescript-test;
};
};
}