git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #104027 from cole-h/crate2nix

crate2nix: init at 0.8.0

commit48d4b84f40eadeec95bc5ab46a32323f913277d8 authorAndreas Rammhold <andreas@rammhold.de> dateTue 17 Nov 2020, 22:23 (6 years ago) parent0749c7d011ecb8
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
@@ -9970,6 +9970,8 @@ julia_15 = callPackage ../development/compilers/julia/1.5.nix {
99709970 inherit (darwin.apple_sdk.frameworks) Security;
99719971 };
99729972
9973+ crate2nix = callPackage ../development/tools/rust/crate2nix { };
9974+
99739975 maturin = callPackage ../development/tools/rust/maturin { };
99749976 inherit (rustPackages) rls;
99759977 rustfmt = rustPackages.rustfmt;