src/nixos-anywhere.sh: add shebang

It's not strictly needed because Nix wraps it with
writeShellApplication, but it makes it easier for the script to be
standalone and use the right syntax highlighter in shells.

Invoke it with bash in the README because of the Nix build sandbox
missing /usr/bin/env
This commit is contained in:
zimbatm 2023-05-10 10:33:28 +02:00
parent 44e8a437f2
commit 8e4a684ff5
2 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,7 @@ nix run github:numtide/nixos-anywhere -- root@yourip --flake github:your-user/yo
The parameter passed to `--flake` should point to your nixos configuration
exposed in your flake (`nixosConfigurations.your-system` in the example above).
<!-- `$ ./src/nixos-anywhere.sh --help` -->
<!-- `$ bash ./src/nixos-anywhere.sh --help` -->
```
Usage: nixos-anywhere [options] ssh-host

View File

@ -1,3 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
showUsage() {
cat <<USAGE
Usage: nixos-anywhere [options] ssh-host