This repository has been archived on 2024-06-01. You can view files and clone it, but cannot push or open issues or pull requests.
rustboyadvance-ng/flake.nix
Muhammad Nauman Raza 3b958a6e22 flake: init
Former-commit-id: 5749b46b4c3804d0d6ab64e8c53c13f1f6fb4b2c
Former-commit-id: 399646eee3d51e3298ac8a3d153e4d80ed2668ba
2024-03-22 19:39:44 +00:00

60 lines
1.5 KiB
Nix

{
description = "Rust development environment for oxitoko using fenix";
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,
nixgl,
...
}:
utils.lib.eachDefaultSystem
(
system: let
pkgs = import nixpkgs-unstable {
inherit system;
overlays = [fenix.overlays.default nixgl.overlay];
};
toolchain = pkgs.fenix.complete;
in rec
{
# Executed by `nix build`
packages.default =
(pkgs.makeRustPlatform {
inherit (toolchain) cargo rustc;
})
.buildRustPackage {
pname = "oxitoko";
version = "1.0.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
};
# 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 # rust components
])
SDL2 SDL2_image
mold clang
];
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
};
}
);
}