Skip to content

Commit 1ab4ef0

Browse files
committed
Use flake instead shell to allow using nixpkgs-unstable
BPF targets currently require nightly, and nixpkgs-unstable have (unreleased) LLVM 20 which is needed to work with latest nightly.
1 parent 3ead4ef commit 1ab4ef0

File tree

4 files changed

+100
-16
lines changed

4 files changed

+100
-16
lines changed

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
use nix
1+
use flake

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright lowRISC Contributors.
2+
# Licensed under the MIT License, see LICENSE for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
{
5+
inputs = {
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
7+
flake-utils.url = "github:numtide/flake-utils";
8+
};
9+
10+
outputs = {
11+
nixpkgs,
12+
flake-utils,
13+
...
14+
}:
15+
flake-utils.lib.eachDefaultSystem (
16+
system: let
17+
pkgs = import nixpkgs {inherit system;};
18+
in {
19+
devShells = {
20+
default = pkgs.mkShell {
21+
buildInputs = with pkgs; [udev];
22+
nativeBuildInputs = with pkgs; [
23+
rustup
24+
pkg-config
25+
bpf-linker
26+
27+
# For llvm-objdump
28+
llvmPackages_20.bintools
29+
30+
# To aid testing
31+
runc
32+
];
33+
};
34+
};
35+
formatter = pkgs.alejandra;
36+
}
37+
);
38+
}

shell.nix

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)