-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
104 lines (90 loc) · 2.99 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
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
{
description = "Minimalist Media Manager (mkube)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
fenix = {
url = "github:nix-community/fenix/monthly";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-analyzer-src.follows = "";
};
flake-utils.url = "github:numtide/flake-utils";
advisory-db = {
url = "github:rustsec/advisory-db";
flake = false;
};
};
outputs = { self, nixpkgs, crane, fenix, flake-utils, advisory-db, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
rust-toolchain = (fenix.packages.${system}.toolchainOf {
channel = "1.71.0";
sha256 = "sha256-ks0nMEGGXKrHnfv4Fku+vhQ7gx76ruv6Ij4fKZR3l78=";
});
in
let
inherit rust-toolchain system;
pkgs = import nixpkgs {
inherit system;
};
craneLib = crane.lib.${system};
in {
checks = {
mkube-bin = pkgs.callPackage ./mkube.nix { inherit pkgs craneLib rust-toolchain; };
};
packages = {
default = pkgs.callPackage ./mkube.nix { inherit pkgs craneLib rust-toolchain; };
};
apps.default = flake-utils.lib.mkApp {
drv = pkgs.callPackage ./mkube.nix { inherit pkgs craneLib rust-toolchain; };
};
devShells.default = pkgs.mkShell {
inputsFrom = builtins.attrValues self.checks.${system};
# Extra inputs can be added here
nativeBuildInputs = with pkgs; [
(rust-toolchain.withComponents [
"cargo"
"rustc"
])
pkg-config
];
buildInputs = [
(rust-toolchain.withComponents [
"cargo"
"rustc"
])
pkgs.ffmpeg
pkgs.ffmpeg.dev
pkgs.ffmpeg.lib
pkgs.llvmPackages_latest.libclang
pkgs.rustPlatform.bindgenHook
pkgs.openssl
pkgs.dbus.lib
pkgs.samba
pkgs.samba.dev
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.libiconv
];
LIBCLANG_PATH = "${pkgs.llvmPackages_latest.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS =
# Includes with normal include path
(builtins.map (a: ''-I"${a}/include"'') [
# add dev libraries here (e.g. pkgs.libvmi.dev)
pkgs.glibc.dev
pkgs.ffmpeg.dev
pkgs.samba.dev
pkgs.dbus.dev
])
# Includes with special directory paths
++ [
''-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"''
''-I"${pkgs.glib.dev}/include/glib-2.0"''
''-I${pkgs.glib.out}/lib/glib-2.0/include/''
];
};
}
);
}