-
Notifications
You must be signed in to change notification settings - Fork 27
/
flake.nix
52 lines (45 loc) · 1.29 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
{
description = "compress-tools-rs";
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
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
msrvToolchain = toolchainOf {
channel = "1.65.0";
sha256 = "sha256-DzNEaW724O8/B8844tt5AVHmSjSQ3cmzlU4BP90oRlY=";
};
in
combine [
(msrvToolchain.withComponents [ "rustc" "cargo" "rust-src" "clippy" ])
latest.rustfmt
latest.rust-analyzer
];
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rust-toolchain
rust-bindgen
pkg-config
libarchive
clang
llvmPackages.libclang
cargo-release
];
# why do we need to set the library path manually?
shellHook = ''
export LIBCLANG_PATH="${pkgs.llvmPackages.libclang}/lib";
'';
};
});
}