nac3_sca/flake.nix

51 lines
1.5 KiB
Nix
Raw Normal View History

2021-10-07 21:49:13 +08:00
{
description = "The third-generation ARTIQ compiler";
inputs.nixpkgs.url = github:NixOS/nixpkgs/master;
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
2021-10-08 08:18:42 +08:00
in rec {
2021-10-07 21:49:13 +08:00
packages.x86_64-linux = {
nac3artiq = pkgs.python3Packages.toPythonModule (
pkgs.rustPlatform.buildRustPackage {
name = "nac3artiq";
src = self;
2021-11-02 15:17:10 +08:00
cargoSha256 = "sha256-si/yuVrRnXXLp8fMo5ZORHXa5JUqI2YqQ9U4R3UEUL0=";
2021-11-02 14:00:20 +08:00
nativeBuildInputs = [ pkgs.python3 pkgs.llvm_12 ];
buildInputs = [ pkgs.python3 pkgs.libffi pkgs.libxml2 pkgs.llvm_12 ];
2021-10-07 21:49:13 +08:00
cargoBuildFlags = [ "--package" "nac3artiq" ];
cargoTestFlags = [ "--package" "nac3core" "--package" "nac3artiq" ];
installPhase =
''
TARGET_DIR=$out/${pkgs.python3Packages.python.sitePackages}
mkdir -p $TARGET_DIR
cp target/x86_64-unknown-linux-gnu/release/libnac3artiq.so $TARGET_DIR/nac3artiq.so
'';
}
);
};
devShell.x86_64-linux = pkgs.mkShell {
name = "nac3-dev-shell";
buildInputs = with pkgs; [
2021-11-02 14:00:20 +08:00
llvm_12
clang_12
lld_12
2021-10-07 21:49:13 +08:00
cargo
2021-11-02 18:13:59 +08:00
cargo-insta
2021-10-07 21:49:13 +08:00
rustc
libffi
libxml2
clippy
(python3.withPackages(ps: [ ps.numpy ]))
];
};
2021-10-08 08:18:42 +08:00
hydraJobs = {
inherit (packages.x86_64-linux) nac3artiq;
};
2021-10-07 21:49:13 +08:00
};
}