forked from NixOS/nix
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shebang flakes #1
Closed
Closed
Commits on Aug 18, 2023
-
Enables shebang usage of nix shell. All arguments with `#! nix` get added to the nix invocation. This implementation does NOT set any additional arguments other than placing the script path itself as the first argument such that the interpreter can utilize it. Example below: ``` #!/usr/bin/env nix #! nix shell --quiet #! nix nixpkgs#bash #! nix nixpkgs#shellcheck #! nix nixpkgs#hello #! nix --ignore-environment --command bash # shellcheck shell=bash set -eu shellcheck "$0" || exit 1 function main { hello echo 0:"$0" 1:"$1" 2:"$2" } "$@" ``` fix: include programName usage
Configuration menu - View commit details
-
Copy full SHA for 6dd10bd - Browse repository at this point
Copy the full SHA 6dd10bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 021e3f8 - Browse repository at this point
Copy the full SHA 021e3f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5dafd1e - Browse repository at this point
Copy the full SHA 5dafd1eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 20d3673 - Browse repository at this point
Copy the full SHA 20d3673View commit details -
Configuration menu - View commit details
-
Copy full SHA for c4215fd - Browse repository at this point
Copy the full SHA c4215fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 18fc581 - Browse repository at this point
Copy the full SHA 18fc581View commit details -
Configuration menu - View commit details
-
Copy full SHA for e38af3a - Browse repository at this point
Copy the full SHA e38af3aView commit details -
Configuration menu - View commit details
-
Copy full SHA for fb21af9 - Browse repository at this point
Copy the full SHA fb21af9View commit details -
libcmd: lookupFileArg(): add baseDir
This will allow a different base directory to be used, matching a shebang script location instead of the working directory.
Configuration menu - View commit details
-
Copy full SHA for 3746bdb - Browse repository at this point
Copy the full SHA 3746bdbView commit details -
nix: Reserve shebang line syntax and only parse double backtick quotes
Being restrictive about syntax leaves opportunity to improve the syntax and functionality later.
Configuration menu - View commit details
-
Copy full SHA for 2cd5449 - Browse repository at this point
Copy the full SHA 2cd5449View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d282f1 - Browse repository at this point
Copy the full SHA 2d282f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ef43fc - Browse repository at this point
Copy the full SHA 9ef43fcView commit details -
nix/installables.cc: Use getCommandBaseDir() where possible
These usages of the working directory are perhaps unlikely to interact with shebangs, but the code is more consistent this way, and we're less likely to miss usages that do interact.
Configuration menu - View commit details
-
Copy full SHA for 1383b04 - Browse repository at this point
Copy the full SHA 1383b04View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d33afe - Browse repository at this point
Copy the full SHA 5d33afeView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.