vaporise/flake.nix

55 lines
1.3 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
cargoLock.lockFile = ./Cargo.lock;
2024-03-14 19:56:42 +00:00
meta.mainProgram = "vpr";
src = ./.;
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 {
buildInputs = with pkgs; [
(with toolchain; [ cargo rustc rust-src clippy rustfmt ])
2024-03-13 19:27:25 +00:00
];
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";
};
}
);
}