-
Notifications
You must be signed in to change notification settings - Fork 77
/
flake.nix
44 lines (38 loc) · 1.73 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
{
description = "flake for `mev-rs` repo";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
crane = {
url = "github:ipetkov/crane";
};
};
outputs = { self, flake-utils, nixpkgs, rust-overlay, crane }:
let
overlays = [ (import rust-overlay) ];
pkgs-for-system = system: import nixpkgs { inherit system overlays; };
mev-rs = { system, features ? "" }:
let
pkgs = pkgs-for-system system;
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
in
pkgs.callPackage ./nix/mev-rs.nix { inherit pkgs features; crane = craneLib; };
in
{
nixosModules.mev-rs = import ./nix/module.nix { inherit mev-rs; };
nixosModules.default = self.nixosModules.mev-rs;
packages.x86_64-darwin.mev-rs = mev-rs { system = "x86_64-darwin"; };
packages.x86_64-darwin.default = self.packages.x86_64-darwin.mev-rs;
packages.aarch64-darwin.mev-rs = mev-rs { system = "aarch64-darwin"; };
packages.aarch64-darwin.default = self.packages.aarch64-darwin.mev-rs;
packages.x86_64-linux.mev-rs = mev-rs { system = "x86_64-linux"; };
packages.x86_64-linux.default = self.packages.x86_64-linux.mev-rs;
devShells.x86_64-darwin.default = import ./shell.nix { pkgs = pkgs-for-system "x86_64-darwin"; };
devShells.aarch64-darwin.default = import ./shell.nix { pkgs = pkgs-for-system "aarch64-darwin"; };
devShells.x86_64-linux.default = import ./shell.nix { pkgs = pkgs-for-system "x86_64-linux"; };
};
}