-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
77 lines (73 loc) · 1.65 KB
/
flake.nix
File metadata and controls
77 lines (73 loc) · 1.65 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
{
description = "distributed-metrics - Prometheus metrics backed by Bitping's distributed network";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
rust-overlay,
...
}:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor =
system:
import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
in
{
packages = forAllSystems (
system:
let
pkgs = pkgsFor system;
rustToolchain = pkgs.rust-bin.stable.latest.default;
in
{
default = pkgs.rustPlatform.buildRustPackage {
pname = "distributed-metrics";
version = "1.2.3";
src = ./.;
cargoHash = "sha256-fEv3zOHDvHNM90ClkwqqTKX1ts+9iOGIsynTmU//+Fc=";
};
}
);
devShells = forAllSystems (
system:
let
pkgs = pkgsFor system;
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [
"rust-src"
"rust-analyzer"
"clippy"
];
};
in
{
default = pkgs.mkShell {
buildInputs = [
rustToolchain
pkgs.cargo-audit
pkgs.cargo-watch
pkgs.cargo-dist
];
env = {
RUST_BACKTRACE = "1";
};
};
}
);
};
}