-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
61 lines (52 loc) · 1.95 KB
/
flake.nix
File metadata and controls
61 lines (52 loc) · 1.95 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
{
# Based on 'github:jiribenes/effekt-template'
description = "Effekt tutorial for <Programming> 2025";
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
pname = "effekt-tutorial"; # package name
version = "0.1.0"; # package version
mainFile = "main.effekt"; # relative path to an entrypoint (as a string)
testFiles = [ ]; # 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;
};
}
);
}