git.iko.soy/typeable/nixpkgs
on master help sign in
crate2nix: init at 0.8.0

crate2nix is a tool that "generates nix build files for rust crates using cargo". Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

commit011ecb8f904daf95f238cc594f016f15a97cd7f3 authorCole Helbling <cole.e.helbling@outlook.com> dateMon 16 Nov 2020, 22:16 (6 years ago) parent01816a4
2 files changed+49
pkgs/development/tools/rust/crate2nix/default.nix+47 pkgs/top-level/all-packages.nix+2
pkgs/development/tools/rust/crate2nix/default.nixnew file+47
@@ -0,0 +1,47 @@
1+{ lib
2+, rustPlatform
3+, fetchFromGitHub
4+, makeWrapper
5+
6+, cargo
7+, nix
8+, nix-prefetch-git
9+}:
10+
11+rustPlatform.buildRustPackage rec {
12+ pname = "crate2nix";
13+ version = "0.8.0";
14+
15+ src = fetchFromGitHub
16+ {
17+ owner = "kolloch";
18+ repo = pname;
19+ rev = version;
20+ sha256 = "sha256-pqg1BsEq3kGmUzt1zpQvXgdnRcIsiuIyvtUBi3VxtZ4=";
21+ } + "/crate2nix";
22+
23+ cargoSha256 = "sha256-dAMWrGNMleQ3lDbG46Hr4qvCyxR+QcPOUZw9r2/CxV4=";
24+
25+ nativeBuildInputs = [ makeWrapper ];
26+
27+ # Tests use nix(1), which tries (and fails) to set up /nix/var inside the
28+ # sandbox
29+ doCheck = false;
30+
31+ postFixup = ''
32+ wrapProgram $out/bin/crate2nix \
33+ --suffix PATH ":" ${lib.makeBinPath [ cargo nix nix-prefetch-git ]}
34+ '';
35+
36+ meta = with lib; {
37+ description = "A Nix build file generator for Rust crates.";
38+ longDescription = ''
39+ Crate2nix generates Nix files from Cargo.toml/lock files
40+ so that you can build every crate individually in a Nix sandbox.
41+ '';
42+ homepage = "https://github.com/kolloch/crate2nix";
43+ license = licenses.asl20;
44+ maintainers = with maintainers; [ kolloch andir cole-h ];
45+ platforms = platforms.all;
46+ };
47+}
pkgs/top-level/all-packages.nix+2
@@ -9969,6 +9969,8 @@ julia_15 = callPackage ../development/compilers/julia/1.5.nix {
99699969 inherit (darwin.apple_sdk.frameworks) Security;
99709970 };
99719971
9972+ crate2nix = callPackage ../development/tools/rust/crate2nix { };
9973+
99729974 maturin = callPackage ../development/tools/rust/maturin { };
99739975 inherit (rustPackages) rls;
99749976 rustfmt = rustPackages.rustfmt;