add default.nix

This commit is contained in:
shimun 2020-08-12 12:53:58 +02:00
parent 9960febb4a
commit 0ff92614c5
Signed by: shimun
GPG Key ID: E81D8382DC2F971B

20
default.nix Normal file
View File

@ -0,0 +1,20 @@
let
pkgs = import <nixpkgs> { };
name = "brownpaper";
src = ./.;
crate2nix_tools = import "${builtins.fetchTarball { url = "https://github.com/kolloch/crate2nix/archive/0.8.0.tar.gz"; sha256 = "17mmf5sqn0fmpqrf52icq92nf1sy5yacwx9vafk43piaq433ba56"; }}/tools.nix" { };
overrides = pkgs.defaultCrateOverrides // {
libloading = attrs: {
buildInputs = with pkgs; [ pkg-config ];
};
brownpaper = attrs: {
buildInputs = with pkgs; [ gmp ];
};
nettle-sys = attrs: with pkgs; {
buildInputs = [ pkg-config nettle clang ];
LIBCLANG_PATH = "${clang.cc.lib}/lib";
};
};
project = pkgs.callPackage (crate2nix_tools.generatedCargoNix { inherit name; inherit src; }) { defaultCrateOverrides = overrides; };
in
project.rootCrate.build