static-nix-shell: dont fail build if "nix-shell" occurs in the file as a non-directive
This commit is contained in:
@@ -73,8 +73,8 @@ in rec {
|
|||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
substituteInPlace ${srcPath} \
|
substituteInPlace ${srcPath} \
|
||||||
--replace '#!/usr/bin/env nix-shell' '#!${interpreter}' \
|
--replace-fail '#!/usr/bin/env nix-shell' '#!${interpreter}' \
|
||||||
--replace \
|
--replace-fail \
|
||||||
'#!nix-shell -i ${interpreterName}${pkgsStr}' \
|
'#!nix-shell -i ${interpreterName}${pkgsStr}' \
|
||||||
'# nix deps evaluated statically'
|
'# nix deps evaluated statically'
|
||||||
'';
|
'';
|
||||||
@@ -85,7 +85,7 @@ in rec {
|
|||||||
mv ${srcPath} $out/bin/${srcPath}
|
mv ${srcPath} $out/bin/${srcPath}
|
||||||
|
|
||||||
# ensure that all nix-shell references were substituted
|
# ensure that all nix-shell references were substituted
|
||||||
(! grep nix-shell $out/bin/${srcPath}) || exit 1
|
(! grep '#![ \t]*nix-shell' $out/bin/${srcPath}) || exit 1
|
||||||
|
|
||||||
'' + lib.optionalString doWrap ''
|
'' + lib.optionalString doWrap ''
|
||||||
# add runtime dependencies to PATH
|
# add runtime dependencies to PATH
|
||||||
|
Reference in New Issue
Block a user