61 lines
1.6 KiB
Nix
61 lines
1.6 KiB
Nix
{
|
|
description = "Code behind chir.rs";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
rust-overlay = {
|
|
url = "github:oxalica/rust-overlay";
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
cargo2nix = {
|
|
url = "github:cargo2nix/cargo2nix";
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.rust-overlay.follows = "rust-overlay";
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
cargo2nix,
|
|
...
|
|
} @ args:
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [cargo2nix.overlays.default];
|
|
};
|
|
rustPkgs = pkgs.rustBuilder.makePackageSet {
|
|
packageFun = import ./Cargo.nix;
|
|
rustChannel = "nightly";
|
|
extraRustComponents = ["clippy" "rustfmt"];
|
|
packageOverrides = pkgs: pkgs.rustBuilder.overrides.all;
|
|
};
|
|
in rec {
|
|
formatter = pkgs.alejandra;
|
|
devShells.default = rustPkgs.workspaceShell {
|
|
buildInputs = with pkgs; [
|
|
cargo-bloat
|
|
cargo-crev
|
|
cargo-deny
|
|
cargo-edit
|
|
cargo-outdated
|
|
cargo-tarpaulin
|
|
dhall
|
|
dhall-json
|
|
cargo2nix.packages.${system}.cargo2nix
|
|
];
|
|
};
|
|
packages = builtins.mapAttrs (_: value: value {}) rustPkgs.workspace;
|
|
hydraJobs =
|
|
if (system == "x86_64-linux" || system == "aarch64-linux")
|
|
then {
|
|
inherit formatter devShells packages;
|
|
}
|
|
else {};
|
|
});
|
|
}
|