add template subcommand

This commit is contained in:
Julie B. 2021-08-27 18:43:56 +02:00
parent 8c48fbed0d
commit 67f392e120
5 changed files with 15 additions and 2 deletions

View File

@ -2,7 +2,10 @@
## Imperative guests
A guest declaration must live in a Nix Flake. To get started, you can use the
flake template.
flake template with the following shortcut:
```sh
miniguest template my-guests/
```
To build and deploy a guest, run
```sh

View File

@ -39,4 +39,7 @@ remove)
create)
source create.bash
;;
template)
source template.bash
;;
esac

View File

@ -16,7 +16,7 @@
# along with Miniguest. If not, see <https://www.gnu.org/licenses/>.
# ARG_POSITIONAL_SINGLE(command, subcommand to run)
# ARG_TYPE_GROUP_SET(commands, COMMAND, command, [install,upgrade,remove,create,help])
# ARG_TYPE_GROUP_SET(commands, COMMAND, command, [install,upgrade,remove,create,template,help])
# ARG_OPTIONAL_SINGLE(guests-dir, , directory containing guests profiles, /etc/miniguests)
# ARG_OPTIONAL_SINGLE(nix, , path to the nix binary, @nixFlakes@/bin/nix)
# ARG_LEFTOVERS(subcommand arguments)

5
tool/template.bash Normal file
View File

@ -0,0 +1,5 @@
source template_arg.bash
dest_dir="$_arg_dest_dir"
run_nix flake new -t github:bbjubjub2494/miniguest "$dest_dir"

2
tool/template_arg.bash Normal file
View File

@ -0,0 +1,2 @@
# ARG_POSITIONAL_SINGLE(dest-dir, destination directory)
# ARGBASH_GO