[nxc init] now can also use the nix flake templates
Add some cli args to use the templates instead of copying the folders in /examples
:
nxc init -t [template]
# or
nxc init --template [template]
ex:
nxc init -t webserver
there is also a flag to either fetch the template locally. by default we fetch the template from the flake on master on gitlab.
to use the local templates:
nxc init -t websever --use-local-templates
Merge request reports
Activity
requested review from @orichard
can now also list the available templates:
$ nxc init --list-templates-json --use-local-templates { "basic": "Minimal example", "basic-flake-only": "Basic example with nix dir via flake", "basic-nur": "Basic example using a NUR", "kernel": "Example with different Linux Kernels", "multi-composistions": "A multi-compositions example", "spark": "Spark example", "webserver": "A nginx example" }
I added a derivation able to generate a json file with the information about the templates. the
nxc init
command callsnix build
to get the json file. this allows us to be able to fetch the templates on the git and also locallyactually there might be some issues with the fetching of the git's templates. maybe templates of the git will differ in version compared to the local install of
nxc
the best thing would be in actually install the flake locally and then call itnix registry add nxc git+https://gitlab.inria.fr/nixos-compose/nixos-compose
mentioned in commit 8244c07c