feat(wrapperModules.oh-my-posh): init#500
Conversation
|
given the lack of What would the criteria be to determine which type the provided file is of those 3? File extension? Option? Either? Somewhat busy tonight, will be reviewing stuff again tomorrow night probably |
I was thinking file extension.
I try to implement an extra option on top, but only if it is opt-in. I don't want them to write config.configFile = {
path = ./my-config.yaml;
fileType = "yaml";
}They should use the single-line syntax from above where |
Dont worry about it, file extension is fine. |
e38691e to
47c78bf
Compare
Done! |
10e0ac3 to
b7fe76e
Compare
|
Ok, config merging is fully reworked. In a nutshell, if you specify multiple settings they will be chained together using the .extends key in the order specified in In case you specified an .extends key explictly, we don't modify it (the chain is "broken"). See the description and tests (there are plenty :-)) for more details. The main use case it, that people might want to use a theme but override some stuff (which was not really possible in my initial version). Since most of the omp settings are in nested lists (segments within blocks) it is a bit clumsy to override them. |
8eb41e0 to
7a3e3b9
Compare
add check.nix implement omp + checks fix fileContains add configFile option clean up tests simplify use optionalString use omp-native "extends" feature to merge configs add config-chain folder preserve original names in config chain add foo.omp.json handle reverse traversal of ordered settings remove config-chain dir if empty ensure that settings get copied to config-chain properly copy settings.json remove nix store hash from config file update tests cleanup test refactor simplify tmp file rename _omp_out --> dst simplify copy case rework json normalization fix tests wip cleanup nix recursion rewrite recurse from the end of the list simplify chainFiles cleanup unreachable configs improve docs linting improve docs cleanup improve errMsgs in testlib add config.json test add test for breaking config-chain add test for extending segments remove dummie configs
7a3e3b9 to
cc79e71
Compare
|
Did some cleanup on the tests. I think this is now ready for review. |
So this is basically a copy of the starship wrapper except:
One thing that is missing though:
Omp also allow passing yaml files to --config. I've seen no
importYamlequivalent toimportJSON/importTOML.So in order to support YAML we might also allow another option
configFilewhich can be either JSON/TOML/YAML (kinda like I had in my first proposal for the starship module, where @BirdeeHub argued - rightly so - that it was not needed since users can simply useimportTOMLif they want to write a native toml file.I was thinking reading from this new option, and normalize the yaml/toml/json to json using
yqin the builder and also generalize theorderfield to define the order between[theme nix-settings configFile].Thoughts, @BirdeeHub ?