Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nix-shell file for building with nix #578

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# shell.nix

# NOTE we need mkShellNoCC
# mkShell would add the regular gcc, which has no ada (gnat)
# https://github.com/NixOS/nixpkgs/issues/142943

with import <nixpkgs> { };
mkShellNoCC {
buildInputs = [
ccache
cmake
curl
flashrom
git
git-lfs
gmp
gnat12 # gcc with ada
hidapi
libossp_uuid
m4 flex bison # Generate flashmap descriptor parser
mpfr
ncurses # make menuconfig
nss
openssl
pkg-config
python3
qemu # test the image
rustup
util-linux
zlib
];
shellHook = ''
# Set variables for libraries
export LD_LIBRARY_PATH=${gmp}/lib:${mpfr}/lib:${zlib}/lib

# TODO remove?
NIX_LDFLAGS="$NIX_LDFLAGS -lncurses"

# Setup Git repo
git lfs install
git lfs pull
git submodule update --init --recursive --checkout --progress

# coreboot sdk
make -C coreboot CPUS="$(nproc)" crossgcc-i386
make -C coreboot CPUS="$(nproc)" crossgcc-x64
make -C coreboot gitconfig
'';
}