-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathflake.nix
More file actions
88 lines (86 loc) · 2.49 KB
/
flake.nix
File metadata and controls
88 lines (86 loc) · 2.49 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
description = "Flake for lfest-rs";
inputs = {
nixpks.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
hongdown.url = "github:dahlia/hongdown";
bencher.url = "github:MathisWellmann/bencher";
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
rust-overlay,
flake-utils,
hongdown,
naersk,
bencher,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {
inherit system overlays;
};
rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain:
toolchain.default.override {
extensions = [
"rust-src"
"rust-analyzer"
"miri"
];
targets = ["x86_64-unknown-linux-gnu"];
});
naersk' = let
toolchain = pkgs.rust-bin.nightly."2025-11-13".default.override {
extensions = [
"rust-src"
"rustc-dev"
"llvm-tools"
];
targets = ["x86_64-unknown-linux-gnu"];
};
in
pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
};
cargo-upgrades = pkgs.callPackage ./nix/cargo-upgrades.nix {};
creusot = import ./nix/creusot.nix {inherit pkgs naersk';};
buildInputs = [
rust
];
rust_tools = with pkgs; [
cargo-nextest
cargo-semver-checks
cargo-mutants
cargo-upgrades
cargo-tarpaulin # Code coverage
cargo-audit
cargo-machete
creusot # Execute with `cargo creusot`
taplo # Format `.toml` files.
];
nix_tools = with pkgs; [
alejandra # Nix code formatter.
deadnix # Nix dead code checker
statix # Nix static code checker.
];
tools = with pkgs; [
mprocs # Run multiple commands in parallel from `mprocs.yml`, acting essentially as a local CI system.
hongdown.packages.${system}.hongdown
bencher.packages.${system}.bencher
];
in
with pkgs; {
devShells.default = mkShell {
buildInputs = buildInputs ++ rust_tools ++ nix_tools ++ tools;
RUST_BACKTRACE = "1";
};
}
);
}