-
Notifications
You must be signed in to change notification settings - Fork 5
/
default.nix
54 lines (50 loc) · 1.16 KB
/
default.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
{
stdenv,
lib,
buildEnv,
ruby,
makeBinaryWrapper,
defaultGemConfig,
buildRubyGem,
...
}@pkgs:
# this is where we specify how the ruby environment should be built
{
name ? "ruby-nix", # passed along to buildEnv
gemset ? { }, # path to gemset.nix or its content
ruby ? pkgs.ruby, # allow ruby to be overriden
gemConfig ? defaultGemConfig, # specific build instructions for native gems
groups ? null, # null or a list of groups, used by Bundler.setup
document ? [ ], # e.g. [ "ri" "rdoc" ]
extraRubySetup ? null, # additional setup script goes here
}:
let
my = import ./mylib.nix pkgs;
requirements = (
pkgs
// {
inherit
my
name
ruby
gempaths
gemConfig
groups
document
extraRubySetup
;
gemset =
if builtins.typeOf gemset == "set" then
gemset
else
(if builtins.pathExists gemset then import gemset else { });
}
);
inherit (import ./modules/gems requirements) gempaths;
inherit (import ./modules/ruby-env requirements) env envMinimal;
in
rec {
version = "v0.1.2";
ruby = env.ruby;
inherit env envMinimal;
}