diff options
Diffstat (limited to 'src/nix/flake-init.md')
-rw-r--r-- | src/nix/flake-init.md | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/nix/flake-init.md b/src/nix/flake-init.md index 890038016..fc1f4f805 100644 --- a/src/nix/flake-init.md +++ b/src/nix/flake-init.md @@ -24,19 +24,23 @@ R""( This command creates a flake in the current directory by copying the files of a template. It will not overwrite existing files. The default -template is `templates#defaultTemplate`, but this can be overridden +template is `templates#templates.default`, but this can be overridden using `-t`. # Template definitions -A flake can declare templates through its `templates` and -`defaultTemplate` output attributes. A template has two attributes: +A flake can declare templates through its `templates` output +attribute. A template has two attributes: * `description`: A one-line description of the template, in CommonMark syntax. * `path`: The path of the directory to be copied. +* `welcomeText`: A block of markdown text to display when a user initializes a + new flake based on this template. + + Here is an example: ``` @@ -45,9 +49,19 @@ outputs = { self }: { templates.rust = { path = ./rust; description = "A simple Rust/Cargo project"; + welcomeText = '' + # Simple Rust/Cargo Template + ## Intended usage + The intended usage of this flake is... + + ## More info + - [Rust language](https://www.rust-lang.org/) + - [Rust on the NixOS Wiki](https://nixos.wiki/wiki/Rust) + - ... + ''; }; - templates.defaultTemplate = self.templates.rust; + templates.default = self.templates.rust; } ``` |