set up basic infrastructure for all templates

This commit is contained in:
wuyoli 2023-01-23 22:24:43 +01:00
parent e1b68a857a
commit c16a39a213
2 changed files with 37 additions and 2 deletions

View File

@ -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
## 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 <projectName>
$ cd <projectName>
$ nix flake init -t templates#<nameOfTheTemplate>
$ git init
$ git add .
```
You will have to replace all occurances of `TEMPLATE_NAME` with your `<project_name>`.
## Provided Templates

15
flake.nix Normal file
View File

@ -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;
};
}