Add mechanism to extend the PATH var on the derivation

This commit is contained in:
Sameer Rahmani 2024-02-29 21:24:22 +00:00
parent 518b3d8f91
commit 33965e2b28
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
1 changed files with 24 additions and 10 deletions

View File

@ -40,6 +40,8 @@
gcc,
ltex-ls,
bash,
supportPython ? true,
}:
with builtins;
let
@ -54,8 +56,26 @@ let
maintainers = import ./maintainers.nix;
runtimeBins = [
ripgrep
git
ltex-ls
] ++ (lib.optional supportPython [
python311
# Python deps
python311
pyright
python3Packages.black
python3Packages.pylint
python3Packages.flake8
]);
paths = map (x: "${x}/bin/") (lib.lists.flatten runtimeBins);
pathsStr = lib.strings.concatStrings (lib.strings.intersperse ":" paths);
in stdenv.mkDerivation (final: rec{
pname = "fg42$";
pname = "fg42";
version = "4.0.0";
src = srcDir;
@ -80,6 +100,7 @@ in stdenv.mkDerivation (final: rec{
export FG42_HOME=${placeholder "out"}/share/fg42/
export FG42_EMACSD=~/.fg42/v4/emacs.d
export FG42_USE_NIX=true;
export PATH=${pathsStr}:$PATH
LIBRARY_PATH="\$(${stdenv.cc}/bin/cc -print-file-name=libgccjit.so):\$LIBRARY_PATH" \
FG42_WM=fales ${emacsBundle}/bin/emacs \
@ -96,6 +117,7 @@ in stdenv.mkDerivation (final: rec{
export FG42_HOME=${placeholder "out"}/share/fg42/
export FG42_EMACSD=~/.fg42/v4/emacs.d
export FG42_USE_NIX=true;
export PATH=${pathsStr}:$PATH
# Disable access control for the current user.
xhost +SI:localuser:$USER
@ -127,15 +149,7 @@ in stdenv.mkDerivation (final: rec{
${vazir-fonts}
${fira-code}
${nerdfonts}
${ripgrep}
${git}
${ltex-ls}
# Python deps
${python311}/bin/python
${pyright}
${python3Packages.black}
${python3Packages.pylint}
${python3Packages.flake8}
${lib.strings.concatLines paths}
EOF
runHook postBuild