diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2022-03-10 17:03:16 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2022-03-10 17:10:15 +0000 |
commit | e5c42bba9bf76d00fb15ec9a179bf91aa81c38c6 (patch) | |
tree | 7597549f36313859d15cb4ae80c04af955c9a223 /src/nix/flake-init.md | |
parent | 1ef88da3503b88f289a15786dfd48821cf5b6502 (diff) | |
parent | 4d98143914120d0163f5c50f30ce8a5289433f8f (diff) |
Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputs
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; } ``` |