-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
62 lines (57 loc) · 2.33 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnsupportedSystem = true;
};
in
{
formatter = pkgs.nixpkgs-fmt;
devShells.default =
with pkgs;
mkShell {
nativeBuildInputs = [
pkg-config
rust-bindgen
cmake
];
buildInputs = [
] ++ lib.optionals stdenv.isDarwin [
iconv
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.SystemConfiguration
darwin.apple_sdk.frameworks.CoreServices
];
CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS= lib.lists.fold (a: b: "${a} ${b}") "" [
"-Ctarget-feature=-crt-static"
"-Clink-arg=-target"
"-Clink-arg=x86_64-apple-darwin"
];
CC_x86_64_apple_darwin =
"${pkgs.pkgsCross.x86_64-darwin.stdenv.cc}/bin/x86_64-apple-darwin-clang";
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER =
"${pkgs.pkgsCross.x86_64-darwin.stdenv.cc}/bin/x86_64-apple-darwin-clang";
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Ctarget-feature=-crt-static";
CC_x86_64_unknown_linux_gnu =
"${pkgs.pkgsCross.gnu64.stdenv.cc}/bin/x86_64-unknown-linux-gnu-gcc";
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER =
"${pkgs.pkgsCross.gnu64.stdenv.cc}/bin/x86_64-unknown-linux-gnu-gcc";
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-Ctarget-feature=-crt-static";
CC_aarch64_unknown_linux_gnu =
"${pkgs.pkgsCross.aarch64-multiplatform.stdenv.cc}/bin/aarch64-unknown-linux-gnu-gcc";
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER =
"${pkgs.pkgsCross.aarch64-multiplatform.stdenv.cc}/bin/aarch64-unknown-linux-gnu-gcc";
};
});
}