nix: fix shell bootstrapper
This commit is contained in:
parent
261b81c8a7
commit
7ab5cf053f
|
@ -5,29 +5,28 @@
|
||||||
|
|
||||||
{ stdenv, mkShell, target-os, git }:
|
{ stdenv, mkShell, target-os, git }:
|
||||||
|
|
||||||
let
|
# Declare a specialized mkShell function which adds some bootstrapping
|
||||||
shell' = shellAttr:
|
# so that e.g. STATUS_REACT_HOME is automatically available in the shell
|
||||||
shellAttr // {
|
attrs:
|
||||||
nativeBuildInputs = (shellAttr.nativeBuildInputs or [ ]) ++ [ git ];
|
(mkShell.override({ inherit stdenv; }) attrs)
|
||||||
TARGET_OS = target-os;
|
.overrideAttrs(super: {
|
||||||
shellHook = ''
|
nativeBuildInputs = (super.nativeBuildInputs or [ ]) ++ [ git ];
|
||||||
set -e
|
TARGET_OS = target-os;
|
||||||
|
shellHook = ''
|
||||||
|
set -e
|
||||||
|
|
||||||
export STATUS_REACT_HOME=$(git rev-parse --show-toplevel)
|
export LANG="en_US.UTF-8"
|
||||||
|
export LANGUAGE="en_US.UTF-8"
|
||||||
|
|
||||||
${shellAttr.shellHook or ""}
|
export STATUS_REACT_HOME=$(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
if [ "$IN_NIX_SHELL" != 'pure' ] && [ ! -f $STATUS_REACT_HOME/.ran-setup ]; then
|
${super.shellHook or ""}
|
||||||
$STATUS_REACT_HOME/scripts/setup
|
|
||||||
touch $STATUS_REACT_HOME/.ran-setup
|
|
||||||
fi
|
|
||||||
|
|
||||||
set +e
|
if [ "$IN_NIX_SHELL" != 'pure' ] && [ ! -f $STATUS_REACT_HOME/.ran-setup ]; then
|
||||||
'';
|
$STATUS_REACT_HOME/scripts/setup
|
||||||
};
|
touch $STATUS_REACT_HOME/.ran-setup
|
||||||
# Declare a specialized mkShell function which adds some bootstrapping
|
fi
|
||||||
# so that e.g. STATUS_REACT_HOME is automatically available in the shell
|
|
||||||
mkShell' = shellAttr:
|
|
||||||
(mkShell.override { inherit stdenv; }) (shell' shellAttr);
|
|
||||||
|
|
||||||
in mkShell'
|
set +e
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue