Skip to content

feat: add Nix flake dev shell for local development#205

Merged
jfernandez merged 1 commit intomainfrom
feat/nix-dev-shell
Mar 28, 2026
Merged

feat: add Nix flake dev shell for local development#205
jfernandez merged 1 commit intomainfrom
feat/nix-dev-shell

Conversation

@jfernandez
Copy link
Copy Markdown
Contributor

Provides a reproducible development environment with all system dependencies (clang, elfutils, zlib, libbpf) needed to build bpftop without cross or Docker. Uses selective hardeningDisable for BPF-incompatible flags (the same pattern used by systemd in nixpkgs). Activates automatically via direnv with use flake.

Building bpftop requires system libraries (libelf, zlib, libbpf) and
a clang that can target BPF. Rather than relying on cross/Docker or
manually installing deps, this adds a Nix flake devShell that provides
everything needed. It activates automatically via direnv.

Nix's cc-wrapper injects hardening flags that break BPF compilation,
so we selectively disable the incompatible ones (zerocallusedregs,
shadowstack, pacret) — the same approach systemd uses in nixpkgs.
@jfernandez jfernandez merged commit dd1cadf into main Mar 28, 2026
4 checks passed
@jfernandez jfernandez deleted the feat/nix-dev-shell branch March 28, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant