-
Notifications
You must be signed in to change notification settings - Fork 268
/
gleam.nix
51 lines (41 loc) · 1.04 KB
/
gleam.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
{ pkgs, config, lib, inputs, ... }:
let
cfg = config.languages.gleam;
setup = ''
To use gleam, you need to add the following to your devenv.yaml:
inputs:
gleam-nix:
url: github:vic/gleam-nix
overlays:
- default
Optionally, if you want a specific gleam branch or version, do
the following:
inputs:
gleam:
url: github:gleam-lang/gleam/main # or any other branch
flake: false
gleam-nix:
url: github:vic/gleam-nix
overlays:
- default
inputs:
gleam = "gleam"
'';
gleamPkg = pkgs.gleam or (throw setup);
in
{
options.languages.gleam = {
enable = lib.mkEnableOption "tools for Gleam development";
package = lib.mkOption {
type = lib.types.package;
default = gleamPkg;
description = "The Gleam package to use.";
defaultText = lib.literalExpression "pkgs.gleam";
};
};
config = lib.mkIf cfg.enable {
packages = [
cfg.package
];
};
}