overview: modularize NIX_CONFIG#1097
Conversation
erictapen
left a comment
There was a problem hiding this comment.
Hey Mark, this is a cool addition to the growing module system of the overview page!
| "NIX_CONFIG='${concatSettings}'"; | ||
| }; | ||
| settings = mkOption { | ||
| type = with types; listOf (submodule ./config-item.nix); |
There was a problem hiding this comment.
I think the submodule definition could be inlined here. I think file granularity still needs to be figured out but for now as a rule of thumb stuff that doesn't have a __toString attr shouldn't live in its own file.
There was a problem hiding this comment.
Actually nevermind, just saw what @fricklerhandwerk did in #1092 and it was his idea in the first place, so let's roll with this granularity.
There was a problem hiding this comment.
__toString attr shouldn't live in its own file.
It doesn't, but arguably we could have collapsed ./config-item into this module.
| options = { | ||
| name = mkOption { | ||
| type = types.str; | ||
| default = name; | ||
| }; | ||
| value = mkOption { | ||
| type = with types; either str (listOf str); | ||
| }; | ||
| }; |
There was a problem hiding this comment.
The NIX_CONFIG thing is a bit tricky. In the instructions what we really want to show is how to set the environment variable to the right value. This is challenging here because NIX_CONFIG is multiline. A convenient rendering will look differently for different shells. So what this change should really be about is
- adding a shell-code snippet the modular way
- encoding how to cleverly render setting a multi-line shell variable for bash
the nix configuration we don't need to re-invent -- it's already a NixOS module option, and we should even be able to re-use its rendering logic to produce a string that Nix will accept (not sure though, haven't looked).
then plug it all together such that it displays correctly in the project detail view.
No description provided.