You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should support a registry of flake templates (use our various flake-parts modules), initialize them using nix flake init as well as fill in any user-specific content using the templateGenerators idea in flake-parts/templates#7 (comment)
The goal is to have om init create flakes for any kind of stack, eventually.
Implementation
To extend flake.templates, we can add:
{flake.templateGenerators.default={# The generator to use (string or package)generator="om init";# Arbitrary metaata (of the template) to pass to the generator.templates.default.params={};};}
Here, generator can be an arbitrary derivation (a function that takes pkgs and returns a types.package?) or it can be a string that represents the command line to use to invoke the generator? om init can fetch templates, and look for the special "om init" generator, in which case it can short-circuit by calling the necessary internal initializer function, passing the templates.?.params property as necessary.
Regarding this, for MVP - let's keep the additional config in this repo, so it gives us some leeway to change things in future. Otherwise, we can consider this feature basically done.
Add
This should support a registry of flake templates (use our various
flake-parts
modules), initialize them usingnix flake init
as well as fill in any user-specific content using thetemplateGenerators
idea in flake-parts/templates#7 (comment)The goal is to have
om init
create flakes for any kind of stack, eventually.Implementation
To extend
flake.templates
, we can add:Here,
generator
can be an arbitrary derivation (a function that takespkgs
and returns atypes.package
?) or it can be a string that represents the command line to use to invoke the generator?om init
can fetch templates, and look for the special"om init"
generator, in which case it can short-circuit by calling the necessary internal initializer function, passing thetemplates.?.params
property as necessary.Tasks
flakreate
repo #167flakreate
: Import templates locally and use them #168om init
toflakreate
#169om init
: Useom.templates
for non-standard config #171om init
: Flesh out CLI test #173flake.lock
explosion, by switching to a JSON registry?om init
: Faster registry loading using JSON cache #190The text was updated successfully, but these errors were encountered: