templates: init
This commit is contained in:
parent
4ffa6a63e2
commit
cab19ec5ca
4 changed files with 46 additions and 0 deletions
15
templates/default.nix
Normal file
15
templates/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
mkTemplate = name:
|
||||
let
|
||||
path = ./. + "/${name}";
|
||||
flake = import (path + "/flake.nix");
|
||||
in
|
||||
{ inherit path; }
|
||||
// lib.optionalAttrs (flake ? description) { inherit (flake) description; };
|
||||
|
||||
templates = lib.attrNames (lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./.));
|
||||
in
|
||||
{
|
||||
flake.templates = lib.genAttrs templates mkTemplate;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue