-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
46 lines (39 loc) · 1.42 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
{
description = "dlux hardware brightness daemon";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }: let
pkgsFor = system: import nixpkgs {
inherit system;
}; in (flake-utils.lib.eachDefaultSystem (system:
let pkgs = pkgsFor system; in {
devShells.default = with (pkgsFor system); mkShell {
nativeBuildInputs = [
rustc
rustfmt
clippy
cargo
udev
pkg-config
llvmPackages.libclang
llvmPackages.clang
llvmPackages.clang.libc.dev
];
};
shellHook = ''
# libclang.so
# export LIBCLANG_PATH="$(nix-store -r $(nix-instantiate '<nixpkgs>' -A llvmPackages.libclang))/lib"
# types.h
# TYPES_PATH="$(nix-store -r $(nix-instantiate '<nixpkgs>' -A llvmPackages.clang.libc.dev))/include"
# stddef.h
# STD_PATH="$(nix-store -r $(nix-instantiate '<nixpkgs>' -A llvmPackages.clang))/resource-root/include"
# libclang.so
export LIBCLANG_PATH="${pkgs.llvmPackages.libclang.out}/lib"
# types.h
TYPES_PATH="${pkgs.llvmPackages.clang.libc.dev}/include"
# stddef.h
STD_PATH="${pkgs.llvmPackages.clang.out}/resource-root/include"
export BINDGEN_EXTRA_CLANG_ARGS="-I $TYPES_PATH -I $STD_PATH"
'';
}));
}