-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
76 lines (61 loc) · 2.05 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
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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
fenix,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = (import nixpkgs) {
inherit system;
};
rustToolchain = fenix.packages.${system}.toolchainOf {
channel = "1.84";
date = "2025-01-09";
sha256 = "lMLAupxng4Fd9F1oDw8gx+qA0RuF7ou7xhNU8wgs0PU=";
};
rustPlatform = pkgs.makeRustPlatform {
cargo = rustToolchain.cargo;
rustc = rustToolchain.rustc;
};
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
version = cargoToml.workspace.package.version;
gitRevision = self.shortRev or self.dirtyShortRev;
nativeBuildInputs = with pkgs; [pkg-config];
buildInputs = with pkgs; [openssl];
lintingRustFlags = "-D unused-crate-dependencies";
in {
devShell = pkgs.mkShell {
nativeBuildInputs = nativeBuildInputs;
buildInputs = buildInputs;
packages = with pkgs; [
# Rust toolchain
rustToolchain.toolchain
# Code formatting
treefmt
alejandra
mdl
# Rust dependency linting
cargo-deny
# Container image management
skopeo
];
RUSTFLAGS = lintingRustFlags;
};
packages =
import ./agent {inherit pkgs rustPlatform version gitRevision nativeBuildInputs buildInputs;}
// import ./archiver {inherit pkgs rustPlatform version gitRevision nativeBuildInputs buildInputs;}
// import ./ctl {inherit pkgs rustPlatform version gitRevision nativeBuildInputs buildInputs;}
// import ./event-processor {inherit pkgs rustPlatform version gitRevision nativeBuildInputs buildInputs;};
}
);
}