nix flakes support #85

Merged
sb10q merged 13 commits from mwojcik/zynq-rs:flakes_support into master 2022-01-27 16:26:33 +08:00
Showing only changes of commit 68c8bb09ac - Show all commits

View File

@ -216,13 +216,13 @@
cargoSha256Experiments = "1bvffgr4588bbkjwnhim8rvkjvbnajaiv7hc98b19sr8kb7rcj63"; cargoSha256Experiments = "1bvffgr4588bbkjwnhim8rvkjvbnajaiv7hc98b19sr8kb7rcj63";
cargoSha256SZL = "13022ssk6s2fgxmmh5msbx01fzcmk2cj95fjpxcsmfy14k9wd77l"; cargoSha256SZL = "13022ssk6s2fgxmmh5msbx01fzcmk2cj95fjpxcsmfy14k9wd77l";
Review

Still there?

Still there?
build-crate = name: crate: features: cargoSha256: rustPlatform.buildRustPackage rec { build-crate = name: crate: features: rustPlatform.buildRustPackage rec {
name = "${crate}"; name = "${crate}";
src = builtins.filterSource (path: type: src = builtins.filterSource (path: type:
baseNameOf path != "target" baseNameOf path != "target"
) ./.; ) ./.;
inherit cargoSha256; cargoLock = { lockFile = ./Cargo.lock; };
nativeBuildInputs = [ cargo-xbuild pkgs.llvmPackages_9.clang-unwrapped ]; nativeBuildInputs = [ cargo-xbuild pkgs.llvmPackages_9.clang-unwrapped ];
buildPhase = '' buildPhase = ''
@ -246,8 +246,8 @@
}; };
targetCrates = target: { targetCrates = target: {
"${target}-experiments" = build-crate "${target}-experiments" "experiments" "target_${target}" cargoSha256Experiments; "${target}-experiments" = build-crate "${target}-experiments" "experiments" "target_${target}";
"${target}-szl" = build-crate "${target}-szl" "szl" "target_${target}" cargoSha256SZL; "${target}-szl" = build-crate "${target}-szl" "szl" "target_${target}";
}; };
targets = ["zc706" "coraz7" "redpitaya" "kasli_soc"]; targets = ["zc706" "coraz7" "redpitaya" "kasli_soc"];
allTargetCrates = (builtins.foldl' (results: target: allTargetCrates = (builtins.foldl' (results: target: