43 lines
912 B
Nix
43 lines
912 B
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs =
|
|
inputs:
|
|
inputs.flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = import inputs.nixpkgs { inherit system; };
|
|
|
|
cargoToml = fromTOML (builtins.readFile ./Cargo.toml);
|
|
name = cargoToml.package.name;
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
m4
|
|
];
|
|
in
|
|
{
|
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
|
inherit name nativeBuildInputs;
|
|
src = ./.;
|
|
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
inherit nativeBuildInputs;
|
|
|
|
packages = with pkgs; [
|
|
rustc
|
|
cargo
|
|
clippy
|
|
rustfmt
|
|
rust-analyzer
|
|
];
|
|
};
|
|
}
|
|
);
|
|
}
|