Replies: 1 comment
-
After pondering again on how to generally implement the "second enabling mode" in Home Manager that has been discussed in-depth for the vivid module in nix-community/home-manager#7994, nix-community/home-manager#7996, and #1938, I came up with an upstream solution that coincidentally also reliably solves #543. Since the conclusion is very related to this proposal, let me elaborate. Essentially, #543 boils down to upstream inconsistently guarding Fortunately, Stylix happens to generally solve this with its custom module system ( Considering the sheer amount of Home Manager modules, even Home Manager would benefit from a simple custom module system that merely wraps modules with Extending and generalizing #543 and the "second enabling mode" implies the need to distinguish between installing binaries and everything else. Based on the previously mentioned vivid discussions, it is also beneficial to treat environment variable declarations specially. Based on nix-community/home-manager#8313 (comment), it is also beneficial to treat {
config = {
packages = /* ... */;
files = /* ... */;
variables = /* ... */;
services = /* ... */;
etc = /* ... */;
};
}For reference and context, Specifically, #543 implicitly requests not enabling Some time during the review cycle of #1721, I rewrote my NixOS configuration to leverage a custom and highly ergonomic module system that has more features than the Stylix module system and has an astonishingly simple, although very involved, implementation. Before upstreaming my work and findings to Stylix and Home Manager, I would like to experiment whether it is possible to refactor the core logic of my custom module system into a library to share between my NixOS and Home Manager repositories. If this ends up being impossible, it might be safe to assume that custom module systems are always project-specific and need to be implemented from scratch every time. For reference, I will probably only have time to look into this in at least a month. Based on the previously proposed Home Manager feature set ( Specifying module feature sets inside For clarity, the
Would this not correspond to a
What about calling this feature something like
I suppose this corresponds to the previously proposed Home Manager feature set and would merely re-expose it under
What about calling this feature something like
This proposal is great! Should we elevate this discussion to an issue? On a side note, I am using a "feature" concept in my NixOS configuration for flat (no DAG or tree compositions) module composition where host configurations may contain the following: # The 'os' namespace is my NixOS namespace, analogous to the 'stylix' namespace.
os.features = {
base.enable = true;
server.enable = true;
}; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Methods could include things like:
Having this metadata would allow users to select modules that fit their criteria, without turning off
autoEnableentirely.For example, some users would like to disable code patches because they don't have the resources to compile things locally. Some might want to use only officially supported methods, because these have the least chance to break things.
Beta Was this translation helpful? Give feedback.
All reactions