================== minimal nix-shell invocation with interpreter ================== #!/usr/bin/env nix-shell #!nix-shell -i bash --- (source_file (first_line) (next_line (annotation_line (nix_shell_args (interpreter (sh_arg)))))) ================== non-interpreter argument ================== #!/usr/bin/env nix-shell #!nix-shell -i bash -p gnused --- (source_file (first_line) (next_line (annotation_line (nix_shell_args (interpreter (sh_arg)) (sh_arg) (sh_arg))))) ================== non-interpreter flags ================== #!/usr/bin/env nix-shell #!nix-shell -i bash -p gnused awk --- (source_file (first_line) (next_line (annotation_line (nix_shell_args (interpreter (sh_arg)) (sh_arg) (sh_arg) (sh_arg))))) ================== quoted arguments ================== #!/usr/bin/env nix-shell #!nix-shell -i bash arg\ one 'arg"Two' "'argThree" --- (source_file (first_line) (next_line (annotation_line (nix_shell_args (interpreter (sh_arg)) (sh_arg) (sh_arg) (sh_arg))))) ================== order-independent ================== #!/usr/bin/env nix-shell #!nix-shell -p gnused -i bash --- (source_file (first_line) (next_line (annotation_line (nix_shell_args (sh_arg) (sh_arg) (interpreter (sh_arg)))))) ================== empty nix-shell ================== #!/usr/bin/env nix-shell #!nix-shell --- (source_file (first_line) (next_line (annotation_line))) ================== multiple annotation lines ================== #!/usr/bin/env nix-shell #!nix-shell -p gnused #!nix-shell -i bash --- (source_file (first_line) (next_line (annotation_line (nix_shell_args (sh_arg) (sh_arg)))) (next_line (annotation_line (nix_shell_args (interpreter (sh_arg))))))