Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
64 lines (61 loc) · 1.44 KB
/
Copy pathflake.nix
File metadata and controls
64 lines (61 loc) · 1.44 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
{
description = "bib2json devshell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
fenix,
...
}:
let
supportedSystems = [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
}
);
in
{
# Overlay for the Rust toolchain
overlays.default = final: prev: {
rustToolchain = fenix.packages.${prev.stdenv.hostPlatform.system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-gh/xTkxKHL4eiRXzWv8KP7vfjSk61Iq48x47BEDFgfk=";
};
};
# Inputs for shell environments
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
rustToolchain
rust-analyzer
];
env = {
# Rust-analyzer
RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library";
};
};
}
);
};
}