doc: demonstrace hmModules

This commit is contained in:
Timothy DeHerrera 2021-02-21 14:44:57 -07:00
parent 87008d851c
commit 091e1f5648
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122

26
extern/README.md vendored
View file

@ -7,12 +7,36 @@ used to extend the arguments passed to all NixOS modules, allowing for
arbitrary values to be passed from flake inputs to the rest of your
configuration.
## Home Manager
There is also an `hmModules` attribute set for pulling home-manager modules in
from the outside world:
### Declare:
flake.nix:
```nix
{
inputs.doom-emacs.url = "github:vlaci/nix-doom-emacs";
}
```
extern/default.nix:
```nix
{
hmModules = {
inherit (someFlake.hmModules) anHmModule;
inherit doom-emacs;
};
}
```
### Use:
users/nixos/default.nix:
```nix
{ hmModules, ... }:
{
home-manager.users.nixos = {
imports = [ hmModules.doom-emacs.hmModule ] ;
programs.doom-emacs.enable = true;
};
}
```