feat(nix): add homeManagerModule for declarative settings#199
Open
roeybenarieh wants to merge 5 commits into
Open
feat(nix): add homeManagerModule for declarative settings#199roeybenarieh wants to merge 5 commits into
roeybenarieh wants to merge 5 commits into
Conversation
Adds a homeManagerModules.default flake output that exposes a programs.ambxst.settings option. Each attribute maps to a JSON file written to $XDG_CONFIG_HOME/ambxst/config/<name>.json, allowing users to declaratively configure any ambxst module (bar, theme, compositor, dock, etc.) from their Nix config. Closes Axenide#172
Switch from home.file to xdg.configFile so we can use the onChange hook to run `ambxst reload` whenever a managed config file changes. The reload is guarded by a PID check so it only fires when ambxst is actually running.
ambxst reload may not be in PATH inside the systemd service environment that runs HM activation. Adding || true ensures a failed reload never aborts the build.
Author
|
Some Notes: Would love to hear your thoughts about is PR :-) |
Pass the flake's ambxst package via _module.args so home.nix can use lib.getExe to get the correct store path. This fixes the reload failing silently because ambxst was not in PATH during HM activation.
|
Seems like a good pull request, especially for homemanager. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
homeManagerModules.defaultflake output with aprograms.ambxst.settingsoptionsettingsmaps to a JSON file at$XDG_CONFIG_HOME/ambxst/config/<name>.jsonbar,theme,compositor,system,performance,weather,desktop,lockscreen,prefix,dock,ai,workspaces,notch,overviewUsage
Add the module to your Home Manager config:
Notes
ai,weather) are untouched and remain editable via the GUI.builtins.toJSONhandles all JSON-compatible Nix values: nested attrsets, lists, strings, numbers, booleans, and null.Closes #172