-
Notifications
You must be signed in to change notification settings - Fork 16
/
flake.nix
49 lines (47 loc) · 1.66 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
{
description = "cuid-rust";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
# Proivdes legacy compatibility for nix-shell
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
# Provides some nice helpers for multiple system compatibility
flake-utils.url = "github:numtide/flake-utils";
# Provides rust and friends
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, flake-compat }:
# Calls the provided function for each "default system", which
# is the standard set.
flake-utils.lib.eachDefaultSystem
(system:
# instantiate the package set for the supported system, with our
# rust overlay
let pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
in
# "unpack" the pkgs attrset into the parent namespace
with pkgs;
{
devShell = mkShell {
# Packages required for development.
buildInputs = [
bashInteractive
cargo-audit
cargo-edit
cargo-flamegraph
coreutils
gnumake
jq # used for benchmark parsing
linuxPackages_latest.perf
# Read our toolchain file to determine which version of rust,
# components, and targets to install.
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
rust-analyzer
shellcheck
util-linux # lspcu utility for getting info about cores
];
};
});
}