-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
38 lines (33 loc) · 1.24 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Copyright HighTec EDV-Systeme GmbH 2023
# SPDX-License-Identifier: GPL-3.0-or-later OR Apache-2.0
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell rec {
# nativeBuildInputs is usually what you want -- tools you need to run
# nativeBuildInputs = with pkgs.buildPackages; [ pandoc python3Packages.withPackages(ps: with ps; [ pandocfilters ]) ];
venvDir = "./.venv";
buildInputs = [
# A Python interpreter including the 'venv' module is required to bootstrap
# the environment.
pkgs.python3Packages.python
# This execute some shell code to initialize a venv in $venvDir before
# dropping into the shell
pkgs.python3Packages.venvShellHook
pkgs.pkgsCross.riscv32-embedded.stdenv.cc
pkgs.spike
pkgs.dtc
];
# Run this command, only after creating the virtual environment
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
pip install -r requirements.txt
'';
# Necessary for lief but only since a system upgrade, somehow
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
# Now we can execute any commands within the virtual environment.
# This is optional and can be left out to run pip manually.
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
source ./env
'';
}