You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The home manager module defines the nixvim module with shorthandOnlyDefinesConfig = true;. This means when trying to import a config module, one gets an error unless they make the nixvim config module into a function https://github.com/nix-community/nixvim/blob/main/wrappers/hm.nix#L24
Minimal, Reproducible Example (MRE)
# as a home-manager moduleprograms.nixvim={imports=[./nixvim-config.nix]}
Causes the error error: The option home-manager.users.username.programs.nixvim.imports' does not exist.`
# as a home-manager moduleprograms.nixvim={...}:{imports=[./nixvim-config.nix]}
The Fix
Set shorthandOnlyDefinesConfig = false;. I dont see nixvim using a config option, so this should not break anything.
My Usecase
I want to expose nixvim as a package of my config flake as well as be part of the home manager config. Therefore I have one single config that defines the nixvim options which is then imported in my home-manager config and exposed as a package via inputs'.nixvim.legacyPackages.makeNixvim
The text was updated successfully, but these errors were encountered:
Enabling this only has a benefit when the submodule defines an option named config or options. In such a case it would allow the option to be set with the-submodule.config = "value" instead of requiring the-submodule.config.config = "value".
You're right, this option only has an effect when the submodule has a config or options sub-option. Historically (before #1324) we used to have an options option, so that is likely the original reason why we set shorthandOnlyDefinesConfig.
It won't be set when using (lib.evalModules {}).type, so I'll likely bundle the fix for this into the PR switching away from submoduleWith.
Description
The home manager module defines the nixvim module with
shorthandOnlyDefinesConfig = true;
. This means when trying to import a config module, one gets an error unless they make the nixvim config module into a functionhttps://github.com/nix-community/nixvim/blob/main/wrappers/hm.nix#L24
Minimal, Reproducible Example (MRE)
Causes the error
error: The option
home-manager.users.username.programs.nixvim.imports' does not exist.`To fix it, one has to declare the home manager to not be "shorthand", which gets rid of the error:
The Fix
Set
shorthandOnlyDefinesConfig = false;
. I dont see nixvim using a config option, so this should not break anything.My Usecase
I want to expose nixvim as a package of my config flake as well as be part of the home manager config. Therefore I have one single config that defines the nixvim options which is then imported in my home-manager config and exposed as a package via
inputs'.nixvim.legacyPackages.makeNixvim
The text was updated successfully, but these errors were encountered: