From dc94df6170822eea1047d0c2573649e7f566c2ae Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Tue, 10 Sep 2024 11:21:51 -0600 Subject: [PATCH] add nix-shell file for building with nix --- shell.nix | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..b0aada28 --- /dev/null +++ b/shell.nix @@ -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 { }; +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 + ''; +}