{
inputs = {
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
fenix,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
f = fenix.packages.${system}.default.toolchain;
manifest = (pkgs.lib.importTOML ./Cargo.toml).package;
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
f
fenix.packages.${system}.rust-analyzer
llvmPackages.bintools
];
};
packages.default = (
(pkgs.makeRustPlatform {
cargo = f;
rustc = f;
}).buildRustPackage
{
pname = manifest.name;
version = manifest.version;
cargoLock.lockFile = ./Cargo.lock;
src = pkgs.lib.cleanSource ./.;
buildType = "release";
}
);
}
);
}