-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deps: Add Nix flake for project dependencies (#124)
This flake includes all deps for building "zisk" and related projects. To use it, install Nix package manager by following this guide and call nix develop. Afterwards, use your normal workflow in this environment, e.g. cargo build. I've tested this on ArchLinux and OSX and it should also work on other Linux flavors.
- Loading branch information
Showing
4 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
description = "A flake with project build dependencies"; | ||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
inputs.systems.url = "github:nix-systems/default"; | ||
inputs.flake-utils = { | ||
url = "github:numtide/flake-utils"; | ||
inputs.systems.follows = "systems"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
config.allowUnfreePredicate = pkg: | ||
builtins.elem (nixpkgs.lib.getName pkg) [ "mkl" ]; | ||
}; | ||
in { | ||
devShells.default = pkgs.mkShell { | ||
packages = [ | ||
pkgs.grpc | ||
pkgs.gmp | ||
pkgs.jq | ||
pkgs.libsodium | ||
pkgs.libpqxx | ||
pkgs.libuuid | ||
pkgs.openssl | ||
pkgs.postgresql | ||
pkgs.protobuf | ||
pkgs.secp256k1 | ||
pkgs.nlohmann_json | ||
pkgs.nasm | ||
pkgs.libgit2 | ||
] ++ (pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.mkl ]) | ||
++ (pkgs.lib.optionals pkgs.stdenv.isDarwin | ||
[ pkgs.darwin.apple_sdk.frameworks.Security ]); | ||
|
||
RUSTFLAGS = (builtins.map (a: "-L ${a}/lib") [ pkgs.libgit2 ]); | ||
}; | ||
}); | ||
} |