-
-
Save HackerFoo/558c0b60e5ff75db808d8567c53734e1 to your computer and use it in GitHub Desktop.
What I use to work on Symbiflow on NixOS
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> {} }: | |
# https://sid-kap.github.io/posts/2018-03-08-nix-pipenv.html | |
let manyLinuxFile = | |
pkgs.writeTextDir "_manylinux.py" | |
'' | |
print("in _manylinux.py") | |
manylinux1_compatible = True | |
''; | |
in (pkgs.buildFHSUserEnv rec { | |
name = "sf-shell"; | |
targetPkgs = pkgs: | |
with pkgs; | |
let vtr = stdenv.mkDerivation rec { | |
name = "vtr-${version}"; | |
version = "git"; | |
src = fetchGit { | |
url = "https://github.com/SymbiFlow/vtr-verilog-to-routing.git"; | |
#rev = ""; | |
}; | |
doCheck = false; | |
buildInputs = [ bison flex cmake tbb xorg.libX11 xorg.libXft fontconfig cairo pkgconfig gtk3 ]; | |
meta = with stdenv.lib; { | |
description = "Provides open-source CAD tools for FPGA architecture and CAD research"; | |
homepage = https://github.com/SymbiFlow/vtr-verilog-to-routing/; | |
license = licenses.mit; | |
platforms = platforms.all; | |
}; | |
}; | |
icestorm = pkgs.icestorm.overrideAttrs (oldAttrs: rec { | |
src = fetchGit { | |
url = "https://github.com/cliffordwolf/icestorm.git"; | |
rev = "fa1c932452e8efe1dfcc6ff095e3f7130a7906b1"; # 20190311.0112-gfa1c932 | |
}; | |
}); | |
yosys = pkgs.yosys.overrideAttrs (oldAttrs: rec { | |
src = fetchGit { | |
url = "https://github.com/SymbiFlow/yosys.git"; | |
rev = "f8627bc778f2a255200cc7e911abc0eb2003ec1d"; | |
}; | |
}); | |
textx = python37Packages.buildPythonPackage rec { | |
pname = "textX"; | |
version="1.8.0"; | |
src = python37Packages.fetchPypi { | |
inherit pname version; | |
sha256 = "1vhc0774yszy3ql5v7isxr1n3bqh8qz5gb9ahx62b2qn197yi656"; | |
}; | |
doCheck = false; | |
propagatedBuildInputs = [ python37Packages.arpeggio ]; | |
meta = with lib; { | |
homepage = "https://github.com/textX/textX"; | |
license = licenses.mit; | |
description = "Domain-Specific Languages and parsers in Python made easy"; | |
}; | |
}; | |
fasm = python37Packages.buildPythonPackage rec { | |
name = "fasm"; | |
src = fetchGit { | |
url = "https://github.com/SymbiFlow/fasm.git"; | |
rev = "ddc281a41662bff3efb4a66c5b22307e31e5df44"; # 20190207.1350-gddc281a | |
}; | |
propagatedBuildInputs = [ textx ]; | |
}; | |
hilbertcurve = python37Packages.buildPythonPackage rec { | |
pname = "hilbertcurve"; | |
version = "1.0.1"; | |
src = python37Packages.fetchPypi { | |
inherit pname version; | |
sha256 = "b1ddf58f529219d3b76e8b61ed03e2975a724aff4848b720397c7d5601f49521"; | |
}; | |
doCheck = false; | |
meta = with lib; { | |
homepage = "https://github.com/galtay/hilbertcurve"; | |
license = licenses.mit; | |
description = "Construct Hilbert Curves."; | |
}; | |
}; | |
fpgapkgs = import ../src/nix-fpgapkgs {}; | |
python37 = pkgs.python37.withPackages (p: with p; [ | |
pip | |
virtualenv | |
lxml | |
python-utils | |
six | |
progressbar2 | |
simplejson | |
pyserial | |
setuptools | |
arpeggio | |
textx | |
pytest | |
intervaltree | |
yapf | |
numpy | |
tox | |
sortedcontainers | |
setuptools | |
cytoolz | |
hilbertcurve | |
]); | |
in [ | |
#vtr | |
python37 | |
git | |
cmake | |
gcc | |
clang | |
gnumake | |
cmake | |
conda | |
#yosys | |
openocd | |
libxml2 | |
libxslt | |
git | |
wget | |
zlib | |
binutils | |
xxd | |
verilog | |
sqlite-interactive | |
nodejs | |
pkg-config | |
libftdi | |
fasm | |
#icestorm | |
gtkwave | |
#flock | |
#pipenv | |
which | |
#ncurses | |
xorg.libX11 | |
xorg.libXext | |
xorg.libXrender | |
xorg.libICE | |
xorg.libSM | |
glib | |
#fpgapkgs.vivado | |
ncurses5 | |
#glibc | |
tcl | |
readline | |
perl | |
# add dev tools here | |
fzf | |
m4 | |
silver-searcher | |
bash-completion | |
man | |
colordiff | |
unzip | |
unixtools.script | |
lldb | |
ripgrep | |
lz4 | |
souffle | |
zlib.dev | |
sqlite-interactive.dev | |
libffi | |
]; | |
runScript = '' | |
bash --rcfile <(cat /etc/static/bashrc; echo 'source "${pkgs.fzf}/share/fzf/key-bindings.bash"; source "${pkgs.fzf}/share/fzf/completion.bash"; PS1="\n\[\033[1;36m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\\$\[\033[0m\] "; source ~/.go.sh/load') | |
''; | |
profile = '' | |
export LANG=C.UTF-8 | |
#export YOSYS_GIT=$HOME/src/symbiflow/yosys | |
#export YOSYS=$YOSYS_GIT/local/bin/yosys | |
#export YOSYS_DATADIR=$YOSYS_GIT/local/share/yosys | |
#export VPR=/home/dusty/src/symbiflow/vtr-verilog-to-routing/vpr/vpr | |
export VPR_NUM_WORKERS=`nproc` | |
#export GENFASM=/home/dusty/src/symbiflow/vtr-verilog-to-routing/build/utils/fasm/genfasm | |
#export PYTHON3=`which python3` | |
export OPENOCD=`which openocd` | |
export SF_ROOT=/home/dusty/src/symbiflow-arch-defs | |
#export PYTHONPATH=${manyLinuxFile.out}:/home/dusty/src/prjxray:/usr/lib/python3.7/site-packages:$TMPDIR/lib/python3.7/site-packages:$SF_ROOT/utils | |
export FHS_USER_ENV=true | |
# set SOURCE_DATE_EPOCH so that we can use python wheels | |
SOURCE_DATE_EPOCH=$(date +%s) | |
#virtualenv --python=/usr/bin/python venv | |
#export PATH=$PWD/venv/bin:$PATH | |
''; | |
}).env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment