-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
59 lines (51 loc) · 1.72 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
{
description = "Centipede, a work-in-progress multipathing VPN for improving connection reliability and performance for mobile devices and site-to-site connections.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
crate2nix.url = "github:nix-community/crate2nix";
rust-overlay.url = "github:oxalica/rust-overlay";
};
nixConfig = {
extra-trusted-public-keys = "eigenvalue.cachix.org-1:ykerQDDa55PGxU25CETy9wF6uVDpadGGXYrFNJA3TUs=";
extra-substituters = "https://eigenvalue.cachix.org";
allow-import-from-derivation = true;
};
outputs = { self, nixpkgs, flake-utils, crate2nix, rust-overlay }:
flake-utils.lib.eachSystem ["x86_64-linux" "aarch64-linux"] (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);
cargoNixPath = crate2nix.tools.${system}.generatedCargoNix {
name = "centipede";
src = ./.;
};
cargoNix = import cargoNixPath {
inherit pkgs;
buildRustCrateForPkgs = pkgs: pkgs.buildRustCrate.override {
cargo = rust;
rustc = rust;
};
};
in
{
checks = {
centipede = cargoNix.workspaceMembers.centipede.build.override {
runTests = true;
};
};
packages = rec {
centipede = cargoNix.workspaceMembers.centipede.build;
default = centipede;
};
devShell = pkgs.mkShell {
name = "centipede";
packages = [
rust
];
};
});
}