vaporise/flake.nix

57 lines
1.4 KiB
Nix
Raw Normal View History

2024-03-13 19:27:25 +00:00
{
inputs = {
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
utils.url = "github:numtide/flake-utils";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs-unstable,
utils,
fenix,
...
}:
utils.lib.eachDefaultSystem
(
system: let
pkgs = import nixpkgs-unstable {
inherit system;
overlays = [fenix.overlays.default];
};
toolchain = pkgs.fenix.complete;
in rec
{
packages.default =
(pkgs.makeRustPlatform {
inherit (toolchain) cargo rustc;
})
.buildRustPackage {
pname = "vaporise";
2024-03-14 19:20:28 +00:00
version = "0.2.1";
2024-03-13 19:27:25 +00:00
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
2024-03-14 19:31:03 +00:00
meta = {
mainProgram = "vpr";
};
2024-03-13 19:27:25 +00:00
};
# Executed by `nix run`
apps.default = utils.lib.mkApp {drv = packages.default;};
# Used by `nix develop`
devShells.default = pkgs.mkShell rec {
2024-03-13 21:21:24 +00:00
buildInputs = with toolchain; [
2024-03-13 21:07:42 +00:00
cargo rustc rust-src clippy rustfmt # rust components
2024-03-13 19:27:25 +00:00
];
# Specify the rust-src path (many editors rely on this)
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
};
}
);
}