Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing usage CLI instructions #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
`mix-to-nix` is a small tool for generating nix packages from `mix.lock` files.

## Usage

You can create an overlay, add `mix-to-nix` and use it to generate your nix
packages.

```nix
self: super:
{
foobar =
let
src = fetchGit {
url = https://github.com/example/foobar;
rev = "examplerev000000000000000000000000000000";
ref = "v1.0.0";
};
in
self.callPackage (self.mixToNix src) {};

mixToNix = self.callPackage (fetchGit {
url = "https://github.com/serokell/mix-to-nix";
rev = "examplerev000000000000000000000000000000";
ref = "v1.0.0";
}) {};
}
```

You can also use it to manually generate a `default.nix`:

```sh
mix deps.get
mix escript.build
./mix2nix /path/to/mix.lock > /path/to/default.nix
```