Skip to content
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

Enrich nix flake init with parameters #5

Merged
merged 19 commits into from
Jun 7, 2024
Merged

Enrich nix flake init with parameters #5

merged 19 commits into from
Jun 7, 2024

Conversation

srid
Copy link
Member

@srid srid commented May 29, 2024

Enrich flake templates with a params attribute (eventually, these params will be upstreamed to the respective repos) that defines what to replace in the generated project directory post nix flake init.

This is meant to be consumed by https://github.com/juspay/flakreate which program does the following:

  • Reads a registry of flake templates (by default, this repo)
  • Prompt the user to pick a template
  • Run nix flake init on it
  • Prompt the user to choose replacement values (per the params spec, as you can see defined in this PR)
  • Do the appropriate replacements.

Here's what it looks like to initialize https://github.com/juspay/nix-dev-home whilst doing the appropriate replacements (user name, email):

https://asciinema.org/a/rCOqlKyA3Og8b5WalKV9d1k97

To try this out locally,

nix run github:juspay/flakreate

srid added a commit that referenced this pull request Jun 1, 2024
This is not complete, but will be as part of #5
@srid srid changed the title WIP: Prototype of flake template replacement feature Enrich nix flake init with parameters Jun 1, 2024
@srid srid requested a review from roberth June 1, 2024 23:19
@srid srid marked this pull request as ready for review June 1, 2024 23:23
@srid srid mentioned this pull request Jun 7, 2024
5 tasks
@srid
Copy link
Member Author

srid commented Jun 7, 2024

I'll merge this now, but we can continue the conversation for what the final params spec should be, in #7

@srid srid merged commit 9bd516c into main Jun 7, 2024
2 of 3 checks passed
@srid srid deleted the flakreate branch June 7, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant