diff --git a/flake.nix b/flake.nix index 6322defa..ecdd82b4 100644 --- a/flake.nix +++ b/flake.nix @@ -399,27 +399,33 @@ ''; }); - templates = { - simple = { - description = "Simple dream2nix flake"; - path = ./templates/simple; - welcomeText = '' - You just created a simple dream2nix package! + templates = + { + default = self.templates.simple; + simple = { + description = "Simple dream2nix flake"; + path = ./templates/simple; + welcomeText = '' + You just created a simple dream2nix package! - start with typing `nix flake show` to discover the projects attributes. + start with typing `nix flake show` to discover the projects attributes. - commands: + commands: - - `nix develop` <-- enters the devShell - - `nix build .#` <-- builds the default package (`.#default`) + - `nix develop` <-- enters the devShell + - `nix build .#` <-- builds the default package (`.#default`) - Start hacking and -_- have some fun! + Start hacking and -_- have some fun! - > dont forget to add nix `result` folder to your `.gitignore` + > dont forget to add nix `result` folder to your `.gitignore` - ''; - }; - }; + ''; + }; + } + // (b.mapAttrs (name: value: { + description = "Example: ${name} template"; + path = ./examples/${name}; + }) (l.filterAttrs (n: v: v == "directory") (b.readDir ./examples))); }; }