bunbun/flake.nix

37 lines
1.2 KiB
Nix
Raw Normal View History

2024-03-23 21:58:32 +00:00
{
description = "Rust development environment for bunbun using fenix";
inputs = {
2024-03-23 23:29:18 +00:00
fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs-unstable"; };
2024-03-23 21:58:32 +00:00
utils.url = "github:numtide/flake-utils";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
};
2024-03-23 23:29:18 +00:00
outputs = { self, nixpkgs-unstable, utils, fenix, ... }:
2024-03-23 21:58:32 +00:00
utils.lib.eachDefaultSystem
(
system: let
2024-03-23 23:29:18 +00:00
pkgs = import nixpkgs-unstable { inherit system; overlays = [fenix.overlays.default]; };
2024-03-23 21:58:32 +00:00
toolchain = pkgs.fenix.complete;
in rec
{
packages.default =
(pkgs.makeRustPlatform {
inherit (toolchain) cargo rustc;
})
.buildRustPackage {
pname = "bunbun";
2024-03-25 11:27:11 +00:00
version = "1.3.0";
2024-03-23 21:58:32 +00:00
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
};
apps.default = utils.lib.mkApp {drv = packages.default;};
devShells.default = pkgs.mkShell rec {
buildInputs = with pkgs; [
2024-03-23 23:29:18 +00:00
(with toolchain; [ cargo rustc rust-src clippy rustfmt ])
2024-03-23 21:58:32 +00:00
];
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
};
}
);
}