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