mirror of
https://github.com/vladtrc/iw4L
synced 2026-10-26 10:19:50 -04:00
1b8c4df703
Dev shell for x86_64-linux, aarch64-linux and aarch64-darwin. The toolchain comes from rust-toolchain.toml with rust-src and rust-analyzer, and .envrc loads the make-style .env.
65 lines
1.5 KiB
Nix
65 lines
1.5 KiB
Nix
{
|
|
description = "iw4L development shell";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
rust-overlay = {
|
|
url = "github:oxalica/rust-overlay";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
rust-overlay,
|
|
flake-utils,
|
|
}:
|
|
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ] (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [ (import rust-overlay) ];
|
|
};
|
|
toolchain = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override {
|
|
extensions = [
|
|
"rust-src"
|
|
"rust-analyzer"
|
|
];
|
|
};
|
|
runtimeLibs = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux (
|
|
with pkgs;
|
|
[
|
|
alsa-lib
|
|
libxkbcommon
|
|
udev
|
|
vulkan-loader
|
|
wayland
|
|
libx11
|
|
libxcursor
|
|
libxi
|
|
libxrandr
|
|
]
|
|
);
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
nativeBuildInputs = with pkgs; [
|
|
toolchain
|
|
pkg-config
|
|
cmake
|
|
clang
|
|
git
|
|
];
|
|
buildInputs = runtimeLibs;
|
|
LD_LIBRARY_PATH = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux (
|
|
pkgs.lib.makeLibraryPath runtimeLibs
|
|
);
|
|
};
|
|
}
|
|
);
|
|
}
|