-
Notifications
You must be signed in to change notification settings - Fork 47
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 dogfood template (fix #104 and #121) #156
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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