38 lines
586 B
Nix
Raw Normal View History

2025-02-09 23:53:27 +01:00
{
pkgs,
lib,
config,
...
}:
with lib;
let
rustPackage = pkgs.rustc;
in
{
options.rust = {
enable = mkEnableOption "Rust";
# TODO: Add option to specify toolchain file
# See https://ayats.org/blog/nix-rustup
};
config = mkIf config.rust.enable {
2025-02-09 23:57:47 +01:00
packages = with pkgs; [
2025-02-10 00:10:55 +01:00
rustPackage
2025-02-09 23:53:27 +01:00
cargo
2025-02-10 00:10:55 +01:00
clippy
rustfmt
cargo-audit
2025-02-09 23:53:27 +01:00
2025-02-10 00:10:55 +01:00
bacon
evcxr
2025-02-09 23:53:27 +01:00
# TODO: Might be needed for bindgen
# rustPlatform.bindgenHook
# pkg-config
];
# env.RUST_SRC_PATH = "${rustPackage}/lib/rustlib/src/rust/library";
};
}