-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
modules: add minimal entrypoint to only enable core modules
#7970
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
base: master
Are you sure you want to change the base?
Conversation
khaneliman
left a comment
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 like the concept and it does seem to highlight a couple weird reference dependencies that we could code for.
| ./programs/zsh | ||
| ./programs/ion.nix | ||
| ./programs/nushell.nix | ||
| ./services/window-managers/i3-sway/default.nix # Dependency of home-cursor module |
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 seems like it should be addressed with defensive logic. We should not rely on sway being present for home-cursor logic.
| if minimal then | ||
| [ | ||
| ./programs/bash.nix | ||
| ./programs/autojump.nix # Dependency of bash module |
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.
Similar here, we shouldn't rely on the autojump module for bash.
|
Agreed on both fronts - I was just trying to get something minimal working. The sway dependency in sway = {
enable = mkEnableOption "sway config generation for {option}`home.pointerCursor`";
};Definitely seems like something we could just move into the Meanwhile, the imports = [
(lib.mkRenamedOptionModule
[ "programs" "bash" "enableAutojump" ]
[
"programs"
"autojump"
"enable"
]
)
];Renamed modules end up unfortunately creating a dependency on the new location. Maybe we could move the |
c06da70 to
caf4afe
Compare
|
Fixed merge conflicts. |
Description
Currently, home-manager imports every single module by default. This leads to performance penalties as the number of modules increases over time (see the relevant nixpkgs issue. For power users who wish to save on eval time, I've added a
minimalentrypoint. This disables almost all modules underprograms/andservices/, so the user can vendor the modules they actually use manually.To make sure this was working, I set it up in my config, and made sure that only the baseModules I specified were included.
Checklist
Change is backwards compatible.
Code formatted with
nix fmtornix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.Code tested through
nix run .#tests -- test-allornix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
If this PR adds an exciting new feature or contains a breaking change.