Created
September 27, 2019 02:15
-
-
Save HackerFoo/74ae81405e191eb17b2675b28fcd6a94 to your computer and use it in GitHub Desktop.
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 = "c478c2b00131b6f6a4a20d34a43f08f2e95d3336"; | |
}; | |
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 ]; | |
}; | |
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 | |
]); | |
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 | |
# 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=`which genfasm` # /home/dusty/src/symbiflow/vtr-verilog-to-routing/build/utils/fasm/genfasm | |
export PYTHON3=`which python3` | |
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
The
runScript
enabling completion has helped me a lot, thank you! I am using git prompt script to enable branch information in the bash prompt. That was not working when in FHS environment, here is what I've used in my shell.nix based on your code: