static-nix-shell: more clearly mark the nix-shell preambles
This commit is contained in:
@@ -105,13 +105,19 @@ in rec {
|
|||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
#^ TODO: each shell should use preBuild to compute a `shellPreamble`
|
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
echo "$@"
|
echo "$@"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ -n "$shellPreamble" ]; then
|
||||||
|
shellPreamble="
|
||||||
|
# --- BEGIN: nix-shell preamble (generated code) ---
|
||||||
|
$shellPreamble
|
||||||
|
# --- END: nix-shell preamble (generated code) ---
|
||||||
|
"
|
||||||
|
fi
|
||||||
substituteInPlace ${srcPath} \
|
substituteInPlace ${srcPath} \
|
||||||
--replace-fail '#!/usr/bin/env nix-shell' '#!${interpreter}' \
|
--replace-fail '#!/usr/bin/env nix-shell' '#!${interpreter}' \
|
||||||
--replace-fail \
|
--replace-fail \
|
||||||
@@ -241,6 +247,7 @@ in rec {
|
|||||||
pkgsEnv = [ zsh ] ++ (builtins.attrValues pkgsAsAttrs);
|
pkgsEnv = [ zsh ] ++ (builtins.attrValues pkgsAsAttrs);
|
||||||
pkgExprs = insertTopo "zsh" (builtins.attrNames pkgsAsAttrs);
|
pkgExprs = insertTopo "zsh" (builtins.attrNames pkgsAsAttrs);
|
||||||
in mkShell ({
|
in mkShell ({
|
||||||
|
# TODO: generate `shellPreamble` here to reduce wrapping
|
||||||
inherit pkgsEnv pkgExprs;
|
inherit pkgsEnv pkgExprs;
|
||||||
interpreter = lib.getExe zsh;
|
interpreter = lib.getExe zsh;
|
||||||
} // (removeAttrs attrs [ "pkgs" "zsh" ])
|
} // (removeAttrs attrs [ "pkgs" "zsh" ])
|
||||||
@@ -253,6 +260,7 @@ in rec {
|
|||||||
pkgsEnv = builtins.attrValues pkgsAsAttrs;
|
pkgsEnv = builtins.attrValues pkgsAsAttrs;
|
||||||
pkgExprs = insertTopo "python3" (builtins.attrNames pkgsAsAttrs);
|
pkgExprs = insertTopo "python3" (builtins.attrNames pkgsAsAttrs);
|
||||||
in mkShell ({
|
in mkShell ({
|
||||||
|
# TODO: generate `shellPreamble` here to reduce wrapping
|
||||||
inherit pkgsEnv pkgExprs;
|
inherit pkgsEnv pkgExprs;
|
||||||
interpreter = lib.getExe python3;
|
interpreter = lib.getExe python3;
|
||||||
interpreterName = "python3";
|
interpreterName = "python3";
|
||||||
|
Reference in New Issue
Block a user