Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
70 lines (60 loc) · 2.18 KB
/
Copy pathflake.nix
File metadata and controls
70 lines (60 loc) · 2.18 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
{
description = "A real-time stream processing library with simple anomaly detection built with Effekt";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
effekt-nix = {
url = "github:jiribenes/effekt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, effekt-nix }:
let
## Builds for all systems supported by effekt-nix.
## If you want only some specific systems, do the following instead:
# systems = ["aarch64-linux" "aarch64-darwin"];
systems = effekt-nix.lib.supportedSystems;
forAllSystems = nixpkgs.lib.genAttrs systems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
## Project configuration
pname = "real-time-stream-processing-library"; # package name
version = "0.1.0"; # package version
mainFile = "src/main.effekt"; # relative path to entrypoint (as a string)
testFiles = [ "src/test.effekt" ]; # relative paths to tests (as a string)
## Effekt configuration
effektConfig = {
## Uncomment and set a specific version if needed:
# version = "0.10.0";
## Select the backends that your project works on:
backends = bs: with bs; [ js ];
};
in {
packages = forAllSystems (system:
let
effekt-lib = effekt-nix.lib.mkLib nixpkgsFor.${system};
# Chooses the correct Effekt package.
effektBuild = effekt-lib.getEffekt effektConfig;
in {
default = effekt-lib.buildEffektPackage {
inherit pname version;
src = ./.;
main = mainFile;
tests = testFiles;
effekt = effektBuild;
inherit (effektConfig) backends;
};
}
);
devShells = forAllSystems (system:
let
effekt-lib = effekt-nix.lib.mkLib nixpkgsFor.${system};
# Chooses the correct Effekt package.
effektBuild = effekt-lib.getEffekt effektConfig;
in {
default = effekt-lib.mkDevShell {
effekt = effektBuild;
inherit (effektConfig) backends;
};
}
);
};
}