mac flake

This commit is contained in:
Rph :3 2025-04-03 23:03:37 +02:00
parent da43c4be97
commit 39344fe5fa
No known key found for this signature in database

View File

@ -6,30 +6,73 @@
}; };
outputs = { self, nixpkgs, flake-utils, rust-overlay , ...}: outputs = { self, nixpkgs, flake-utils, rust-overlay , ...}:
flake-utils.lib.eachDefaultSystem (system: let
let overlays = [ (import rust-overlay ) ];
overlays = [ (import rust-overlay) ]; in {
pkgs = import nixpkgs { packages."x86_64-linux".default =
inherit system overlays; let
}; pkgs = import nixpkgs {
native-deps = with pkgs; [ system = "x86_64-linux";
pkg-config pipewire lld clang libclang alsa-lib openssl zlib libxkbcommon libGL wayland mangohud inherit overlays;
]; };
in native-deps = with pkgs; [
with pkgs; pkg-config pipewire lld clang libclang alsa-lib openssl zlib libxkbcommon libGL wayland mangohud
{ ];
devShells.default = mkShell { in
buildInputs = with pkgs; [ pkgs.mkShell {
(rust-bin.stable.latest.default.override { buildInputs = with pkgs; [
extensions = [ "rust-src" ]; (rust-bin.stable.latest.default.override {
targets = ["x86_64-unknown-linux-gnu" "x86_64-pc-windows-gnu"]; extensions = [ "rust-src" ];
}) targets = ["x86_64-unknown-linux-gnu" "x86_64-pc-windows-gnu"];
cargo-bloat })
pkgs.pkgsCross.mingwW64.buildPackages.gcc cargo-bloat
] ++ native-deps; pkgs.pkgsCross.mingwW64.buildPackages.gcc
LD_LIBRARY_PATH = (lib.makeLibraryPath native-deps); ] ++ native-deps;
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUSTFLAGS = "-L native=${pkgs.pkgsCross.mingwW64.windows.pthreads}/lib"; LD_LIBRARY_PATH = (pkgs.lib.makeLibraryPath native-deps);
}; CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUSTFLAGS = "-L native=${pkgs.pkgsCross.mingwW64.windows.pthreads}/lib";
} };
); packages."aarch64-darwin".default =
let
pkgs = import nixpkgs {
system = "aarch64-darwin";
inherit overlays;
};
native-deps = with pkgs; [];
in
pkgs.mkShell {
buildInputs = with pkgs; [
(rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
targets = ["aarch64-apple-darwin" ];
})
cargo-bloat
] ++ native-deps;
};
};
# flake-utils.lib.eachDefaultSystem (system:
# let
# overlays = [ (import rust-overlay) ];
# pkgs = import nixpkgs {
# inherit system overlays;
# };
# native-deps = with pkgs; [
# pkg-config pipewire lld clang libclang alsa-lib openssl zlib libxkbcommon libGL wayland mangohud
# ];
# in
# with pkgs;
# {
# devShells.default = mkShell {
# buildInputs = with pkgs; [
# (rust-bin.stable.latest.default.override {
# extensions = [ "rust-src" ];
# targets = ["x86_64-unknown-linux-gnu" "x86_64-pc-windows-gnu"];
# })
# cargo-bloat
# pkgs.pkgsCross.mingwW64.buildPackages.gcc
# ] ++ native-deps;
# LD_LIBRARY_PATH = (lib.makeLibraryPath native-deps);
# CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUSTFLAGS = "-L native=${pkgs.pkgsCross.mingwW64.windows.pthreads}/lib";
# };
# }
# );
} }