-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
104 lines (98 loc) · 2.91 KB
/
flake.nix
File metadata and controls
104 lines (98 loc) · 2.91 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
flake-compat.url = "https://git.lix.systems/lix-project/flake-compat/archive/main.tar.gz";
git-hooks.url = "github:cachix/git-hooks.nix";
systems.url = "github:nix-systems/default";
crane.url = "github:ipetkov/crane";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
# determines systems available for deployment
linux-systems.url = "github:nix-systems/default-linux";
# testing inputs
nixpkgs_current_stable.url = "github:NixOS/nixpkgs/nixos-25.11";
# benchmarking
colmena_benchmarking.url = "github:zhaofengli/colmena/v0.4.0";
};
outputs =
{
self,
flake-parts,
systems,
git-hooks,
crane,
treefmt-nix,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
git-hooks.flakeModule
treefmt-nix.flakeModule
./nix/hooks.nix # pre-commit hooks
./nix/utils.nix # utility functions
./nix/shells.nix
./nix/tests.nix
./crates/cli
./crates/key_agent
./doc
./tests/nix
./runtime
./bench/runner.nix
];
systems = import systems;
flake = {
makeHive = import ./runtime/makeHive.nix;
hydraJobs =
let
inherit (inputs.nixpkgs) lib;
in
{
packages = {
inherit (self.packages.x86_64-linux) docs;
}
// lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: {
inherit (self.packages.${system}) wire wire-small;
});
tests = lib.filterAttrs (n: _: (lib.hasPrefix "vm" n)) self.checks.x86_64-linux;
inherit (self) devShells;
};
};
perSystem =
{
pkgs,
inputs',
config,
lib,
...
}:
{
_module.args = {
toolchain = inputs'.fenix.packages.complete;
craneLib = (crane.mkLib pkgs).overrideToolchain config._module.args.toolchain.toolchain;
inherit self;
};
treefmt = {
programs = {
# rfc style
nixfmt.enable = true;
# docs only
alejandra.enable = true;
rustfmt.enable = true;
prettier.enable = true;
protolint.enable = true;
taplo.enable = true;
ruff-format.enable = true;
};
settings.formatter = {
nixfmt.excludes = [ "doc/snippets/*.nix" ];
prettier.excludes = [ ".sqlx/*" ];
alejandra = {
includes = lib.mkForce [ "doc/snippets/*.nix" ];
};
};
};
};
};
}