forked from l1npengtul/nokhwa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
105 lines (101 loc) · 2.75 KB
/
Copy pathflake.nix
File metadata and controls
105 lines (101 loc) · 2.75 KB
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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = {
self,
nixpkgs,
rust-overlay,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [rust-overlay.overlays.default];
config.allowUnfree = true;
};
rustshell = pkgs.mkShell.override {
stdenv = pkgs.gccStdenv;
};
rustbin = pkgs.rust-bin.selectLatestNightlyWith (
toolchain:
toolchain.default.override {
extensions = [
"rust-src"
"clippy"
"rustfmt"
"miri"
"rust-analyzer"
];
}
);
in {
formatter = pkgs.alejandra;
devShells.default = rustshell {
packages =
[
rustbin
]
++ (with pkgs; [
llvmPackages_21.clangWithLibcAndBasicRtAndLibcxx
pkg-config
cmake
vcpkg
lldb
rustPlatform.bindgenHook
xmlstarlet
opencv
alsa-lib
systemdLibs
cmake
fontconfig
linuxHeaders
v4l-utils
libv4l
pipewire
rustup
gcc
ffmpeg_8-full
nasm
libGL
flite
quirc
lcevcdec
xz
celt
opencore-amr
snappy
codec2
gsm
ilbc
lame
libtheora
libogg
twolame
vo-amrwbenc
vvenc
xavs
xvidcore
soxr
libvdpau
gmp
openapv
svt-av1
]);
env.RUST_SRC_PATH = "${rustbin}/lib/rustlib/src/rust/library";
env.LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
shellHook = let
pathToRustProject = "/project/component[@name='RustProjectSettings']";
in ''
echo "WONDERHOOOOOY!!!!"
xmlstarlet edit --inplace --update "${pathToRustProject}/option[@name='explicitPathToStdlib']/@value" --value "${rustbin}/lib/rustlib/src/rust/library" .idea/workspace.xml
xmlstarlet edit --inplace --update "${pathToRustProject}/option[@name='toolchainHomeDirectory']/@value" --value "${rustbin}/bin" .idea/workspace.xml
'';
};
}
);
}