-
-
Notifications
You must be signed in to change notification settings - Fork 987
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
base: main
Are you sure you want to change the base?
Conversation
@@ -182,29 +214,31 @@ in { | |||
environment.etc."xdg/hypr/hyprland.conf" = let | |||
shouldGenerate = cfg.extraConfig != "" || cfg.settings != {} || cfg.plugins != []; |
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.
Does this mean we can have distro specific configuration now? (which and user config would work together/be merged and then evaluated?)
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.
In short, no.
The current hyprutils implementation only looks for configs in the order XDG_CONFIG_HOME/hypr -> HOME/.config/hypr -> XDG_CONFIG_DIRS/hypr -> /etc/xdg/hypr
.
I've been meaning to work on extending this to accept configs from multiple sources (hypr.d/xx-config.conf
), but I'm not sure combining user and system configs is such a great idea by default. Can be done with a simple source
though.
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.
Well as we discussed previously on Nixpkgs, enabling distros to apply default configurations would be helpful in cases where we need things to work out of the box, like importing all env vars (including PATH, XDG_DATA_DIRS), enabling/starting certain services.
These default system configs could just be ignored with a flag like disable-distro-config = true
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 is somewhat out of the scope of this PR, but I'm curious what @vaxerski would say about this.
Updated generator that will end up living in Nixpkgs' `lib/generators`.
The downstream module already applies hyprland's finalPackage to the portalPackage.
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.