Packaging/Ruby: Difference between revisions
Tomodachi94 (talk | contribs) m ryantm link -> canonical Nixpkgs manual |
Add example for setting gemConfig for bundlerEnv, extending from defaultGemConfig. |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 36: | Line 36: | ||
<syntaxHighlight lang=console> | <syntaxHighlight lang=console> | ||
$ nix-shell | $ nix-shell | ||
$ bundle | $ bundle lock # generates Gemfile.lock | ||
$ bundix # generates gemset.nix | $ bundix # generates gemset.nix | ||
</syntaxHighlight> | </syntaxHighlight> | ||
| Line 92: | Line 92: | ||
} | } | ||
</syntaxHighlight> | </syntaxHighlight> | ||
=== Override gemConfig locally === | |||
<syntaxhighlight lang="nix"> | |||
gems = bundlerEnv { | |||
name = "beef-env"; | |||
inherit ruby; | |||
gemdir = ./.; | |||
gemConfig = pkgs.defaultGemConfig // { | |||
do_sqlite3 = attrs: { | |||
buildInputs = [ sqlite ]; | |||
}; | |||
}; | |||
}; | |||
</syntaxhighlight> | |||
| Line 115: | Line 128: | ||
}; | }; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
== Using Bundler 2 == | == Using Bundler 2 == | ||
Bundler 2 comes included with Ruby, so instead of importing <code>ruby.devEnv</code> import Ruby and Bundix separately. | Bundler 2 comes included with Ruby, so instead of importing <code>ruby.devEnv</code> import Ruby and Bundix separately. | ||
[[Category:Development]] | |||
[[Category:Ruby]] | |||