nix-super/src
Tom Bereknyei 74210c12fe Shellbang support with flakes
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

EDIT: For posterity I've changed shellwords to shellwords2 in order
      not to interfere with other changes during a rebase.
      shellwords2 is removed in a later commit. -- roberth
2023-11-07 13:24:01 -05:00
..
build-remote Allow dynamic derivation deps in inputDrvs 2023-09-07 10:39:37 -04:00
libcmd Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
libexpr Fix boost::bad_format_string exception in builtins.addErrorContext (#9291) 2023-11-06 19:13:40 +00:00
libfetchers Merge pull request #9283 from obsidiansystems/mememory-source-accessor 2023-11-06 19:51:02 +01:00
libmain Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
libstore Merge pull request #9293 from ThinkChaos/ssh-misc-improvments 2023-11-06 13:33:51 -05:00
libutil Shellbang support with flakes 2023-11-07 13:24:01 -05:00
nix Shellbang support with flakes 2023-11-07 13:24:01 -05:00
nix-build Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
nix-channel Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
nix-collect-garbage Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
nix-copy-closure Remove stray executable permissions on source files 2023-11-02 09:24:21 +01:00
nix-env Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
nix-instantiate Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
nix-store Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
resolve-system-dependencies Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00