Created
July 29, 2023 17:58
-
-
Save Binary-Eater/e157ac7f1acbc8290e9feac3e6d361bf to your computer and use it in GitHub Desktop.
Nix shell for linux kernel development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {}, unstable ? import <nixos-unstable> {} }: | |
let | |
binutils = unstable.binutils; # need binutils >=2.39 for DWARF5 debuginfo | |
llvmPackages_14 = unstable.llvmPackages_14; | |
sphinx = unstable.sphinx; # need sphinx >=5.x.x due to https://github.com/sphinx-doc/sphinx/issues/10495 | |
in | |
pkgs.mkShell { | |
SPHINXBUILD = "${pkgs.sphinx}/bin/sphinx-build"; | |
TERMINFO_DIRS = "/run/current-system/sw/share/terminfo"; # make menuconfig | |
# Disable things like clang stack protector | |
hardeningDisable = [ "all" ]; # needed by make samples/bpf | |
nativeBuildInputs = with pkgs; [ | |
bc | |
bison | |
binutils | |
llvmPackages_14.clang | |
flex | |
gcc | |
gnumake | |
llvmPackages_14.llvm | |
perl | |
git # checkpatch | |
elfutils # used by tools/ which is run on build host | |
openssl # used by certs/ which is run on build host | |
# used by scripts/clang-tools/gen_compile_commands.py | |
(python3.withPackages (p: with p; [ | |
# used by scripts/checkpatch.pl | |
GitPython | |
ply | |
])) | |
# Used by make rpm-pkg and make binrpm-pkg. | |
rpm | |
rsync | |
man | |
mandoc | |
pahole # BTF support | |
which # needed by make sample/bpf | |
less | |
# Used by make htmldocs and make pdfdocs. | |
sphinx | |
imagemagick | |
graphviz | |
librsvg | |
(texlive.combine { | |
inherit (texlive) | |
scheme-full | |
fontspec | |
euenc | |
# Used by make pdfdocs. | |
xetex | |
xetexref; | |
}) | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment