forked from Losses/rune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cross.devshell.nix
116 lines (108 loc) · 2.47 KB
/
cross.devshell.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{ nixpkgs, rust-overlay, masterPkgs, system }:
let
pkgsCross = nixpkgs.legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform;
rust-bin = rust-overlay.lib.mkRustBin { } pkgsCross.buildPackages;
expidusPkgs = import masterPkgs { inherit system; };
in
pkgsCross.callPackage (
{
eza,
mkShell,
pkg-config,
cmake,
clang,
binutils,
qemu,
openssl,
stdenv,
zstd,
lmdb,
sqlite,
clippy,
rust-analyzer,
rustup,
mount,
protobuf_26,
pcre2,
ninja,
unzip,
fd,
alsa-lib,
libpulseaudio,
pulseaudioFull,
gtk3,
fontconfig,
mesa,
libxkbcommon,
libGL,
wayland,
gcc,
xorg,
libffi,
}:
mkShell {
name = "Cross Shell that Combined Flutter and Rust Dev Shell";
nativeBuildInputs = [
eza
(rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
targets = [ "aarch64-unknown-linux-gnu" ];
})
pkg-config
clang
cmake
binutils
expidusPkgs.flutter
clippy
rust-analyzer
rustup
mount
protobuf_26
pcre2
ninja
unzip
];
depsBuildBuild = [ qemu ];
buildInputs = [
fd
libpulseaudio
pulseaudioFull
gtk3
fontconfig
mesa
libxkbcommon
xorg.libX11
libGL
wayland
zstd
lmdb
sqlite
openssl
alsa-lib
libffi
];
env = {
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = "${stdenv.cc.targetPrefix}cc";
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER = "qemu-aarch64";
RUST_BACKTRACE = 1;
PKG_CONFIG_ALLOW_CROSS = 1;
ZSTD_SYS_USE_PKG_CONFIG = 1;
LIBSQLITE3_SYS_USE_PKG_CONFIG = 1;
};
shellHook = ''
alias ls=exa
alias find=fd
alias rinf='flutter pub run rinf'
alias build='flutter-elinux build elinux --target-arch=arm64'
export PATH=$HOME/.cargo/bin:$HOME/.pub-cache/bin:$PATH
export LDFLAGS="-L${stdenv.cc.cc.lib}/lib -L${wayland}/lib $LDFLAGS"
export PKG_CONFIG_PATH=${zstd.dev}/lib/pkgconfig:${lmdb.dev}/lib/pkgconfig:${sqlite.dev}/lib/pkgconfig:${openssl.dev}/lib/pkgconfig:${alsa-lib.dev}/lib/pkgconfig:${libffi.dev}/lib/pkgconfig:${wayland.dev}/lib/pkgconfig
export CC="${stdenv.cc.targetPrefix}clang"
export CXX="${stdenv.cc.targetPrefix}clang++"
echo "${libffi}"
echo "${libffi.dev}"
echo "Using CC: $CC"
echo "Using CXX: $CXX"
'';
}
) { };