From c16a39a213a564d99a5f625de637d99b011cc3fb Mon Sep 17 00:00:00 2001 From: wuyoli Date: Mon, 23 Jan 2023 22:24:43 +0100 Subject: [PATCH] set up basic infrastructure for all templates --- README.md | 24 ++++++++++++++++++++++-- flake.nix | 15 +++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 flake.nix diff --git a/README.md b/README.md index b33f951..84b9b91 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,23 @@ -# nix_templates +# Template-Flake +This flake provides custom flake templates, while still letting you access the [official flake templates](https://github.com/NixOS/templates). +It was inspired by [this blogpost](https://peppe.rs/posts/novice_nix:_flake_templates/). -A set of useful Nix Flake templates \ No newline at end of file +## Installation +Run +``` +nix registry add templates ~/path/to/this/repository +``` +This will override the default `template`-entry in the nix-registry. +You will still be able to access the official templates *through* this template. + +## Usage +``` +$ mkdir +$ cd +$ nix flake init -t templates# +$ git init +$ git add . +``` +You will have to replace all occurances of `TEMPLATE_NAME` with your ``. + +## Provided Templates diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ddac042 --- /dev/null +++ b/flake.nix @@ -0,0 +1,15 @@ +{ + description = "My Flake templates"; + + inputs = { + official-templates.url = github:NixOS/templates; + }; + + outputs = { official-templates, ... }: rec { + + templates = { + } // official-templates.templates; + + defaultTemplate = templates.trivial; + }; +}