Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aflatter/bundix
Generates a Nix expression for your Bundler-managed application.
https://github.com/aflatter/bundix
Last synced: about 2 months ago
JSON representation
Generates a Nix expression for your Bundler-managed application.
- Host: GitHub
- URL: https://github.com/aflatter/bundix
- Owner: aflatter
- Created: 2014-09-16T15:21:23.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-28T09:57:48.000Z (almost 10 years ago)
- Last Synced: 2023-04-10T11:58:55.963Z (over 1 year ago)
- Language: Ruby
- Size: 145 KB
- Stars: 12
- Watchers: 2
- Forks: 61
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Bundix makes it easy to package your Bundler-enabled applications with the Nix
package manager.### Is it "Production Ready™"?
![DANGER: EXPERIMENTAL](https://raw.github.com/cryptosphere/cryptosphere/master/images/experimental.png)
Nope. It's work-in-progress.
### Installation
Just clone the repo, Nix can handle everything else.
```
git clone https://github.com/aflatter/bundix
```### How does it work?
Bundix builds a definition of your Ruby environment using Bundler and writes a
Nix expression for it. The generated expression can then be loaded and all the
Gem handling etc. will now be handled by Nix.### Usage
1. Change to your project's directory.
2. Generate your definition:
`nix-shell /path/to/bundix/repo --shell 'bundix expr'`
3. Load the definition using `nixpkgs.loadRubyEnv ./.bundix/definition.nix {}`.Example:
```
let
pkgs = import {};
stdenv = pkgs.stdenv;
ruby = pkgs.ruby21;
rubyLibs = pkgs.ruby21Libs;
buildRubyGem = rubyLibs.buildRubyGem;rubyEnv = pkgs.loadRubyEnv ./.bundix/definition.nix {
inherit ruby;
};in with pkgs; rec {
inherit rubyEnv;test = stdenv.mkDerivation rec {
name = "test";
builder = ./builder.sh;
buildInputs = [ rubyEnv.ruby ];
src = ./.;shellHook = ''
export GEM_PATH=${lib.concatStringsSep ":" rubyEnv.gemPath}
'';
};
}
```### Known issues
- Git repositories that host multiple gems are not supported yet. A single gem
per repository will work fine.
- `path` sources are not supported.
- The ruby version specified by your Gemfile is read but not used yet.
Pass `{ ruby = yourRuby; }` to `loadRubyEnv` instead.
- `Bundler.setup` and friends still have to be stubbed out to do nothing.
- There's no support for gem groups yet. All gems are installed.