aboutsummaryrefslogtreecommitdiff
path: root/src/nix/flake-init.md
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-02-28 23:54:20 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-02-28 23:54:20 +0000
commitdc92b01885c0c49d094148b1c4dc871ccdd265ad (patch)
tree9d4426dfe847570906487649c32c5b320697705c /src/nix/flake-init.md
parent79152e307e7eef667c3de9c21571d017654a7c32 (diff)
parent1c985428c4783568bcfb4692c6ce816eb5c5c31d (diff)
Merge remote-tracking branch 'upstream/master' into auto-uid-allocation
Diffstat (limited to 'src/nix/flake-init.md')
-rw-r--r--src/nix/flake-init.md22
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;
}
```