42 lines
942 B
Nix
42 lines
942 B
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
naersk = {
|
|
url = "github:nix-community/naersk/master";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
utils,
|
|
naersk,
|
|
}:
|
|
utils.lib.eachDefaultSystem (system: let
|
|
pkgs = import nixpkgs {inherit system;};
|
|
naersk-lib = pkgs.callPackage naersk {};
|
|
in {
|
|
packages.default = naersk-lib.buildPackage ./.;
|
|
formatter = nixpkgs.legacyPackages.${system}.alejandra;
|
|
checks = {
|
|
inherit (self.packages.${system}) default;
|
|
};
|
|
devShell = with pkgs;
|
|
mkShell {
|
|
buildInputs = [
|
|
cargo
|
|
rustc
|
|
rustfmt
|
|
pre-commit
|
|
rustPackages.clippy
|
|
rust-analyzer
|
|
];
|
|
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
|
};
|
|
});
|
|
}
|