-
Notifications
You must be signed in to change notification settings - Fork 21
/
flake.nix
59 lines (52 loc) · 1.55 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
{
description = "UpdateHub Development Environment";
inputs = {
nixpkgs.url = "nixpkgs/release-22.11";
flake-utils.url = "github:numtide/flake-utils";
rust = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, rust }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rust-toolchain = with rust.packages.${system};
let
msrv = toolchainOf {
channel = "1.65.0";
sha256 = "sha256-DzNEaW724O8/B8844tt5AVHmSjSQ3cmzlU4BP90oRlY=";
};
in
combine [
(msrv.withComponents [ "rustc" "cargo" "rust-src" "clippy" ])
(latest.withComponents [ "rustfmt" "rust-analyzer" ])
];
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
libarchive
linuxHeaders
llvmPackages.libclang
openssl
pkg-config
protobuf
cargo-insta
cargo-limit
cargo-outdated
cargo-release
cargo-watch
rust-toolchain
# used by excluded tests
mtdutils
];
shellHook = with pkgs; ''
# loopdev 0.3.0 uses bindgen to generate its bindings
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"
export BINDGEN_EXTRA_CLANG_ARGS="-I${linuxHeaders}/include/"
'';
};
});
}