-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
62 lines (53 loc) · 1.98 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
{
## TODO: Change to your project's description:
description = "Nix template for Effekt projects";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
effekt-nix = {
url = "github:jiribenes/effekt-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows ="flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils, effekt-nix }:
## If you want only some specific systems, do the following instead:
# flake-utils.lib.eachSystem ["aarch64-linux" "aarch64-darwin"] (system:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
effekt-lib = effekt-nix.lib.${system};
## Project configuration
# TODO: Change to your project's details:
pname = "effekt-template"; # 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 = with effekt-lib.effektBackends; [ js ];
};
# Chooses the correct Effekt package.
effektBuild = effekt-lib.getEffekt effektConfig;
in {
packages.default = effekt-lib.buildEffektPackage {
inherit pname version;
src = ./.;
main = mainFile;
tests = testFiles;
effekt = effektBuild;
inherit (effektConfig) backends;
};
devShells.default = effekt-lib.mkDevShell {
effekt = effektBuild;
};
apps.default = flake-utils.lib.mkApp {
drv = self.packages.${system}.default;
name = pname;
};
}
);
}