Repository navigation
feat: support generating flake.nix via --flake - #834
ArisoN-ext wants to merge 1 commit into
Conversation
- Add `--flake` CLI argument and `flake` configuration file option - Generate a minimalistic `flake.nix` template in the output directory - Format the generated file automatically using the configured formatter
figsoda
left a comment
There was a problem hiding this comment.
this is too opinionated imo, there isn't one convention to make a flake
nix-init is only supplying the description here, you can probably just run cp or something like that in addition to nix-init
The flake is primarily here for convenience. Using nix-init to run programs through a flake is much more convenient. And since flake code style is somewhat subjective — which I agree with. I've kept this one as minimalistic as possible |
there is a thin balance between heavy |
choosing to be minimalistic here is itself subjective, and this is one of the decisions that i don't want nix-init to make
i think finding a balance is being opinionated, what is the right balance is up to personal preference even if we agree on being minimalistic / not using stuff like flake-parts, there are still a lot of small decisions to make, nix-init is by no means completely opinionated, i try my best to follow the consensus on things, but there are some things (e.g. where |
If I may butt in here in defense of flake support: The general point of a program being unopinionated in software development is not to force the user into a desicion they don't want to make. That way software stays extensible, and intercompatible, and headaches are avoided. This program, in particular, is a boilerplate generation tool, essentially. The user is never going to be stuck with code they don't want to use, because they can just change it if they so wish. Now, to make those changes convenient and unintrusive, which is what I think a boilerplate tool should strive to do, it should be as minimal as possible. The particular outcome of choices that need to be taken to provide such a minimal starting point are not nearly as relevant as the fact that they are taken, and are easy to change. Telling users they should just do the script themselves is kind of missing the point here. Everything this tool does can also be done by users manually as well. The entire point is convenience, and truth is a lot of people use flakes, and presumably would like the convenience of being able to generate a relatively suitable boilerplate, just the same as people using traditional nix architectures would. |
--flakeCLI argument andflakeconfiguration file optionflake.nixtemplate in the output directory