tylc/flake.nix

45 lines
960 B
Nix
Raw Permalink Normal View History

2026-06-17 11:47:55 -07:00
{
inputs = {
2026-10-09 18:55:17 -07:00
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst";
2026-06-17 11:47:55 -07:00
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import inputs.nixpkgs { inherit system; };
src = ./.;
cargoToml = fromTOML (builtins.readFile "${src}/Cargo.toml");
2026-06-17 11:47:55 -07:00
name = cargoToml.package.name;
crate = pkgs.rustPlatform.buildRustPackage {
inherit name src;
2026-06-17 11:47:55 -07:00
cargoLock.lockFile = "${src}/Cargo.lock";
nativeBuildInputs = with pkgs; [
m4
];
2026-06-17 11:47:55 -07:00
};
in
{
packages.default = crate;
2026-06-17 11:47:55 -07:00
devShells.default = pkgs.mkShell {
inputsFrom = [ crate ];
2026-06-17 11:47:55 -07:00
packages = with pkgs; [
rustc
cargo
clippy
rustfmt
rust-analyzer
];
};
}
);
}