-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a (stack?/nix?/?) template for the simple/advanced project starting points #18
Comments
Maybe a better alternative is a nix template that can be cloned via nix flakes? |
Yeah, that sounds like a good idea! I've thought of doing so, but haven't gotten around to it yet. I don't personally use stack templates or Nix flake templates much myself, but I think other people definitely do. I imagine people in the Nix ecosystem will be more familiar with nix flake templates, but I don't have a strong opinion here. I'm also not quite sure what goes in to creating or maintaining a Nix flake template, but if someone wanted to send a PR adding one (or at least explain in detail what I need to do to add one), I'd happily merge it. A few things I've seen:
|
$ stack new
Usage: stack new PACKAGE_NAME [--bare] [TEMPLATE_NAME] [-p|--param KEY:VALUE]
[DIR(S)] [--omit-packages] [--force] [--ignore-subdirs]
[--setup-info-yaml URL] [--snapshot-location-base URL] [--help]
Create a new project from a template. Run `stack templates' to see available
templates. Will also initialise if there is no stack.yaml file. Note: you can
also specify a local file or a remote URL as a template; or force an
initialisation.
Available options:
PACKAGE_NAME A valid package name.
--bare Do not create a subdirectory for the project
TEMPLATE_NAME Name of a template - can take the form
[[service:]username/]template with optional service
name (github, gitlab, or bitbucket) and username for
the service; or, a local filename such as foo.hsfiles
or ~/foo; or, a full URL such as
https://example.com/foo.hsfiles.
... It looks like Stack templates can be on an arbitrary github repo, or just any URL. That might be pretty convenient for us as well. Not sure whether more users would prefer a Nix Flake template, or a Stack template. |
yeah; i've definitely used the url-based stack templates before; but i think a nix template might make the most sense idiomatically here, because in theory one may not even have a system-installed stack ... |
there's also this - https://github.com/cookiecutter/cookiecutter - but i've never personally used it before. |
I often want to start a new stacklock2nix project, but find myself copying-and-pasting from a previous example.
It would be convenient to use
stack new
and stack's templates ( https://github.com/commercialhaskell/stack-templates ) to get an starting point.Trivia: It seems like stack-templates might not be accepting submissions though ( commercialhaskell/stack-templates#121 ) so not sure if this is a dead-end.
The text was updated successfully, but these errors were encountered: