Add mechanism to extend the PATH var on the derivation
This commit is contained in:
parent
518b3d8f91
commit
33965e2b28
34
nix/fg42.nix
34
nix/fg42.nix
|
@ -40,6 +40,8 @@
|
||||||
gcc,
|
gcc,
|
||||||
ltex-ls,
|
ltex-ls,
|
||||||
bash,
|
bash,
|
||||||
|
|
||||||
|
supportPython ? true,
|
||||||
}:
|
}:
|
||||||
with builtins;
|
with builtins;
|
||||||
let
|
let
|
||||||
|
@ -54,8 +56,26 @@ let
|
||||||
|
|
||||||
maintainers = import ./maintainers.nix;
|
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{
|
in stdenv.mkDerivation (final: rec{
|
||||||
pname = "fg42$";
|
pname = "fg42";
|
||||||
version = "4.0.0";
|
version = "4.0.0";
|
||||||
|
|
||||||
src = srcDir;
|
src = srcDir;
|
||||||
|
@ -80,6 +100,7 @@ in stdenv.mkDerivation (final: rec{
|
||||||
export FG42_HOME=${placeholder "out"}/share/fg42/
|
export FG42_HOME=${placeholder "out"}/share/fg42/
|
||||||
export FG42_EMACSD=~/.fg42/v4/emacs.d
|
export FG42_EMACSD=~/.fg42/v4/emacs.d
|
||||||
export FG42_USE_NIX=true;
|
export FG42_USE_NIX=true;
|
||||||
|
export PATH=${pathsStr}:$PATH
|
||||||
|
|
||||||
LIBRARY_PATH="\$(${stdenv.cc}/bin/cc -print-file-name=libgccjit.so):\$LIBRARY_PATH" \
|
LIBRARY_PATH="\$(${stdenv.cc}/bin/cc -print-file-name=libgccjit.so):\$LIBRARY_PATH" \
|
||||||
FG42_WM=fales ${emacsBundle}/bin/emacs \
|
FG42_WM=fales ${emacsBundle}/bin/emacs \
|
||||||
|
@ -96,6 +117,7 @@ in stdenv.mkDerivation (final: rec{
|
||||||
export FG42_HOME=${placeholder "out"}/share/fg42/
|
export FG42_HOME=${placeholder "out"}/share/fg42/
|
||||||
export FG42_EMACSD=~/.fg42/v4/emacs.d
|
export FG42_EMACSD=~/.fg42/v4/emacs.d
|
||||||
export FG42_USE_NIX=true;
|
export FG42_USE_NIX=true;
|
||||||
|
export PATH=${pathsStr}:$PATH
|
||||||
|
|
||||||
# Disable access control for the current user.
|
# Disable access control for the current user.
|
||||||
xhost +SI:localuser:$USER
|
xhost +SI:localuser:$USER
|
||||||
|
@ -127,15 +149,7 @@ in stdenv.mkDerivation (final: rec{
|
||||||
${vazir-fonts}
|
${vazir-fonts}
|
||||||
${fira-code}
|
${fira-code}
|
||||||
${nerdfonts}
|
${nerdfonts}
|
||||||
${ripgrep}
|
${lib.strings.concatLines paths}
|
||||||
${git}
|
|
||||||
${ltex-ls}
|
|
||||||
# Python deps
|
|
||||||
${python311}/bin/python
|
|
||||||
${pyright}
|
|
||||||
${python3Packages.black}
|
|
||||||
${python3Packages.pylint}
|
|
||||||
${python3Packages.flake8}
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
|
|
Loading…
Reference in New Issue