I was wondering if someone could help me understand home-manager a little better.
I’ve noticed that a few people use home-manager.lib.homeManagerConfiguration instead of home-manager.nixosModules.home-manager as mentioned in the home-manager manual.
For example I wanted to setup NVF to manage neovim configs and came across this lib.homeManagerConfiguration syntax in their documentation: https://notashelf.github.io/nvf/#sec-example-installation-hm
Since it’s not mentioned in the manual I tried to understand the flake source:
I got stuck pretty quickly by they fact that home-manager.nixOSModules.home-manager appears to be a function instead of a path? How does this work?
error:
… while calling the 'head' builtin
at /nix/store/f30jn7l0bf7a01qj029fq55i466vmnkh-source/lib/attrsets.nix:1574:11:
1573| || pred here (elemAt values 1) (head values) then
1574| head values
| ^
1575| else
… while evaluating the attribute 'value'
at /nix/store/f30jn7l0bf7a01qj029fq55i466vmnkh-source/lib/modules.nix:816:9:
815| in warnDeprecation opt //
816| { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
817| inherit (res.defsFinal') highestPrio;
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/store/f30jn7l0bf7a01qj029fq55i466vmnkh-source/nixos/modules/system/activation/top-level.nix':
… while evaluating the option `assertions':
… while evaluating definitions from `/nix/store/cd0q2vk9vqwjg9rcilymm4x8f4n673zi-source/nixos/common.nix':
… while evaluating the module argument `inputs' in ":anon-5:anon-1":
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: infinite recursion encountered
at /nix/store/f30jn7l0bf7a01qj029fq55i466vmnkh-source/lib/modules.nix:515:28:
514| addErrorContext (context name)
515| (args.${name} or config._module.args.${name})
| ^
516| ) (functionArgs f);