-
-
Save samueldr/b459d4b1d5fcf5120daf7a6509eee02c 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> {} }: | |
let | |
dir = toString ./.; | |
rcfile = pkgs.writeText "lineageos-build-rc" '' | |
[ -n "$PS1" ] && [ -e ~/.bashrc ] && source ~/.bashrc | |
[ -n "$PS1" ] && PS1='\n\[\033[2;32m\]linageos-shell:\w>\[\033[0m\] '; | |
export USE_CCACHE=1 | |
export CCACHE_EXEC=$(which ccache) | |
# Specific to LineageOS... | |
source "${dir}/build/envsetup.sh" | |
''; | |
script = pkgs.writeShellScript "env-setup" '' | |
exec bash --rcfile "${rcfile}" "$@" | |
''; | |
env = pkgs.buildFHSUserEnv { | |
name = "lineageos-build-fhs"; | |
targetPkgs = p: with p; [ | |
# Build utilities | |
ccache | |
# Build deps | |
bc | |
fontconfig | |
freetype | |
gitRepo | |
gnum4 | |
openssl | |
openssl.dev | |
python2 # ewww... | |
python3 # yes, too... | |
zip | |
ncurses5 | |
zlib | |
# Some other utilities | |
xxd | |
]; | |
runScript = script; | |
}; | |
in | |
pkgs.mkShell { | |
name = "lineageos-build-shell"; | |
shellHook = '' | |
exec ${env}/bin/lineageos-build-fhs | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment