46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{
|
|
inputs = {
|
|
naersk.url = "github:nix-community/naersk";
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
utils.url = "github:numtide/flake-utils";
|
|
fenix.url = "github:nix-community/fenix";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
};
|
|
|
|
outputs = inputs:
|
|
with inputs;
|
|
utils.lib.eachDefaultSystem (system:
|
|
let
|
|
overlays = [ (import rust-overlay) ];
|
|
pkgs = import nixpkgs {
|
|
inherit system overlays;
|
|
};
|
|
naersk-lib = pkgs.callPackage naersk { };
|
|
nbi = with pkgs; [
|
|
|
|
(rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
|
|
extensions = [ "rust-src" "rust-analyzer" "clippy" ];
|
|
}))
|
|
cargo-nextest
|
|
cargo-criterion
|
|
pkg-config
|
|
sccache
|
|
];
|
|
|
|
bi = with pkgs; [
|
|
just
|
|
cargo-watch
|
|
samply
|
|
];
|
|
in
|
|
{
|
|
defaultPackage = naersk-lib.buildPackage ./.;
|
|
devShell = with pkgs; mkShell {
|
|
nativeBuildInputs = nbi;
|
|
buildInputs = bi;
|
|
|
|
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
|
};
|
|
}
|
|
);
|
|
}
|