Skip to content

Commit

Permalink
Add a shell.nix and instructions how to use it
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Sep 29, 2021
1 parent 7e46768 commit 227a1d7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -20,6 +20,11 @@ make
./musig2test
```

## Build in nix-shell

The provided `shell.nix` provides build tools and the right version of
`libsodium`, so simply using `nix-shell` and `make` is sufficient to build.

# Disclaimer
This code is work in progress, and has not been audited. Do not use in production.

Expand Down
14 changes: 14 additions & 0 deletions libsodium.nix
@@ -0,0 +1,14 @@
{ pkgs ? import <nixpkgs> {} }:

pkgs.libsodium.overrideAttrs (oldAttrs: {
name = "libsodium-1.0.18-musig2";
src = pkgs.fetchFromGitHub {
owner = "input-output-hk";
repo = "libsodium";
# branch musig2_compat
rev = "7f9f211fcc88d8f0d7a821e5b9041268c392300a";
sha256 = "0527x23z1h4ny492jjmyxpwb48hrlbgibin83w1qm0jqvg441xgp";
};
nativeBuildInputs = [ pkgs.autoreconfHook ];
configureFlags = "--enable-static";
})
7 changes: 7 additions & 0 deletions shell.nix
@@ -0,0 +1,7 @@
{ pkgs ? import <nixpkgs> {}
, libsodium-musig2 ? import ./libsodium.nix { inherit pkgs; }
}:

pkgs.mkShell {
buildInputs = [pkgs.clang libsodium-musig2];
}

0 comments on commit 227a1d7

Please sign in to comment.