-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
58 lines (54 loc) · 1.6 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
crane.url = "github:ipetkov/crane";
};
outputs =
{ self
, nixpkgs
, flake-utils
, rust-overlay
, crane
} @ inputs:
flake-utils.lib.eachDefaultSystem
(system:
let
lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
(import rust-overlay)
];
};
# Attribute set from the overlay
overlayPackages = lib.filterAttrs (n: v: lib.isDerivation v) pkgs.zebraPackages;
in
{
packages = overlayPackages // {
default = overlayPackages.zebra-runner;
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
overlayPackages.rustToolchain # Configured with `./rust-toolchain.toml`
overlayPackages.rustToolchain.availableComponents.rust-analyzer
just
jq
qemu
cargo-binutils
nil
nixpkgs-fmt
] ++ lib.optional pkgs.stdenv.isLinux pkgs.gdb
++ lib.optional pkgs.stdenv.isDarwin (pkgs.gdb.override {
# Fix for https://github.com/NixOS/nixpkgs/pull/223240#issuecomment-1527198145
enableDebuginfod = false;
});
};
}) // {
# Does not need the system attribute
overlays.default = final: prev:
(import ./overlay.nix { inherit final prev inputs; });
};
}