-
-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathflake.nix
More file actions
59 lines (51 loc) · 1.58 KB
/
flake.nix
File metadata and controls
59 lines (51 loc) · 1.58 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
{
description = "The Facet project is a collection of crates pioneering runtime reflection in Rust.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
};
outputs = {
self,
nixpkgs,
rust-overlay,
...
}: let
inherit (nixpkgs) lib;
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
eachSystem = lib.genAttrs systems;
pkgsFor = eachSystem (system:
import nixpkgs {
localSystem.system = system;
overlays = [rust-overlay.overlays.default];
});
in {
devShells =
lib.mapAttrs (system: pkgs: {
default = pkgs.mkShell {
strictDeps = true;
packages = with pkgs; [
# Must occur first to take precedence over nightly.
(rust-bin.stable.latest.minimal.override {
extensions = ["rust-src" "rust-docs" "clippy"];
})
# Use `rustfmt`, and other tools that require nightly features.
(rust-bin.selectLatestNightlyWith (toolchain:
toolchain.minimal.override {
extensions = ["rustfmt" "rust-analyzer"];
}))
cargo-nextest
cargo-insta
just
];
RUST_BACKTRACE = 1;
RUST_LOG = "debug";
};
})
pkgsFor;
formatter = eachSystem (system: nixpkgs.legacyPackages.${system}.alejandra);
};
}