52 lines
1 KiB
Nix
52 lines
1 KiB
Nix
|
# (import (
|
||
|
# fetchTarball {
|
||
|
# url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
|
||
|
# sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }
|
||
|
# ) {
|
||
|
# src = ./.;
|
||
|
# }).defaultNix
|
||
|
{ lib
|
||
|
, naersk
|
||
|
, stdenv
|
||
|
, clangStdenv
|
||
|
, hostPlatform
|
||
|
, targetPlatform
|
||
|
, pkg-config
|
||
|
, libiconv
|
||
|
, rustfmt
|
||
|
, cargo
|
||
|
, rustc
|
||
|
, openssl
|
||
|
}:
|
||
|
let cargoToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml));
|
||
|
in
|
||
|
naersk.lib."${targetPlatform.system}".buildPackage rec {
|
||
|
src = ./.;
|
||
|
|
||
|
buildInputs = [
|
||
|
rustfmt
|
||
|
pkg-config
|
||
|
cargo
|
||
|
rustc
|
||
|
libiconv
|
||
|
openssl
|
||
|
];
|
||
|
|
||
|
checkInputs = [ cargo rustc ];
|
||
|
doCheck = true;
|
||
|
|
||
|
CARGO_BUILD_INCREMENTAL = "false";
|
||
|
RUST_BACKTRACE = "full";
|
||
|
copyLibs = true;
|
||
|
|
||
|
name = cargoToml.package.name;
|
||
|
version = cargoToml.package.version;
|
||
|
|
||
|
meta = with lib; {
|
||
|
description = cargoToml.package.description;
|
||
|
homepage = cargoToml.package.homepage;
|
||
|
license = with licenses; [ mit ];
|
||
|
maintainers = with maintainers; [ ];
|
||
|
};
|
||
|
}
|