Add dogfood template (fix #104 and #121)#156
Conversation
roberth
left a comment
There was a problem hiding this comment.
Apart from the design issues, this would need testing and better inline documentation to explain succinctly the role of each file, etc. (Although don't invest in that before making sure everything works with tests, and maybe don't even test before resolving the double mkFlake design issue)
Besides the double mkFlake broken fixpoint, I have doubts about the module keys. A test should point out that that works, e.g. a test doing a double import and a test for disabledModules.
| # Workaround for https://github.com/hercules-ci/flake-parts/issues/148 | ||
| self = { | ||
| outPath = ./.; | ||
| inherit (self) | ||
| _type inputs lastModified lastModifiedDate narHash outputs sourceInfo submodules; | ||
| }; |
There was a problem hiding this comment.
This breaks normal use of self. I don't think importing from self is important enough of a problem.
Making assumptions about the user's file layout is too magical. You are free to implement your own conventions using the specialArgs solution instead.
| }; | ||
| } | ||
| ./modules/dogfood.nix | ||
| ).flakeModules.dogfood; |
There was a problem hiding this comment.
By conflating the published module and the current flake, you're causing users of the published module to export the published module. This is not right.
|
|
||
| outputs = { flake-parts, self, ... }@inputs: | ||
| flake-parts.lib.mkFlake { inherit inputs; } ( | ||
| flake-parts.lib.mkFlake |
There was a problem hiding this comment.
As mentioned before, this looks a lot like a broken implementation of fixpoint iteration, which is not feasible. In other words, references to the actual flake will not work as expected. We need to tie the lazy fixpoint knot, instead of providing a single fixpoint iteration step (out of a potentially infinite number of steps required).
I don't think this can be done without changing mkFlake.
|
Perhaps a way to work around the problem posed by graphs of public flakeModules is to set the module key by hand (EDIT: inside the module file, or by wrapping the module where you perform your local imports) for now. |
Motivation
Testing