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 76e0eeff40 flake: fix package usage
Former-commit-id: 1a9b9a64a65b53de7ac5899aaf7703c7b5e94d79
Former-commit-id: c50f0daee152e5d0b99429ba26ff85fdcb740b3f
2024-03-22 22:33:11 +00:00

64 lines
1.6 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,
...
}:
utils.lib.eachDefaultSystem
(
system: let
pkgs = import nixpkgs-unstable {
inherit system;
overlays = [fenix.overlays.default];
};
toolchain = pkgs.fenix.complete;
in rec
{
# Executed by `nix build`
packages.default =
(pkgs.makeRustPlatform {
inherit (toolchain) cargo rustc;
})
.buildRustPackage {
pname = "rustboyadvance-ng";
name = "rustboyadvance-ng";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"libretro-backend-0.2.1" = "sha256-qsJo7wP01zhRNv4XrZJbIvOQrSJfUaqve0fNOaR6aWs=";
};
};
};
# 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";
};
}
);
}