-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
nix/module: toHyprconf -> toHyprlang #9221
Conversation
Even simpler now, in case y'all found this too daunting to review :P After implementing |
Updated generator that will end up living in Nixpkgs' `lib/generators`.
The downstream module already applies hyprland's finalPackage to the portalPackage.
Flattening attributes means we no longer need to process categories separately. For all intents and purposes, they do not exist. Simplify the codebase once again, while introducing an easy to grasp recursive function. Add a bit of documentation for toHyprlang, though I doubt it's clear enough even now. Still needs proper NixDoc.
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.
I have nothing left to add, LGTM.
One thing that might possibly come to bite you in the back is the fact that nixpkgs requires test for new library functions, but since this'll be put in generators that might be necessary.
Tests for these functions should be relatively easy to implement. |
Since there haven't been any objections, I'll merge this. |
Describe your PR, what does it fix/add?
Reworks the current Nix to hyprland.conf generator implementation by using a more generic Nix 2 Hyprlang generator.
This allows any application using hyprlang to use this for easy config generation.
This is the second step towards getting this module into Nixpkgs.
Considerations:
section
->category
, to be in line with the documentation.category[special]:field = value
for special categories. This reduces the complexity in finding thespecial
key inside the attrset and then properly ordering it as the first in the generated category. But this poses a question: how should we let the user define these categories?"device[some-device:0baf3-952c]" = { sensitivity = 0.3; }
)toHyprlang
:category:field = value
for everything instead of nested categories (category {...}
). This further reduces complexity by having only one code path for all categories.indentLevel
, no longer needed without expanded categories.importantPrefixes
->topCommandsPrefixes
and also addbottomCommandsPrefixes
for greater flexibility. Group these as the first argument (calledoptions
from now on).attrs
into a standalone argument, after theoptions
arg. This is the actual config that will be translated to hyprlang.CC: @bloxx12 @donovanglover @JohnRTitor @khaneliman @NotAShelf
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Needs testing. Different ideas and constructive criticism welcome.
Is it ready for merging, or does it need work?
Needs testing and discussion.