2021-02-14 03:38:20 +01:00
|
|
|
# External Art
|
|
|
|
When you need to use a module, overlay, or pass a value from one of your inputs
|
|
|
|
to the rest of your NixOS configuration, [extern][extern] is where you do it.
|
|
|
|
|
|
|
|
Modules and overlays are self explanatory, and the `specialArgs` attribute is
|
|
|
|
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.
|
|
|
|
|
2021-02-21 22:44:57 +01:00
|
|
|
## Home Manager
|
2021-02-20 20:42:36 +01:00
|
|
|
There is also an `hmModules` attribute set for pulling home-manager modules in
|
|
|
|
from the outside world:
|
2021-02-21 22:44:57 +01:00
|
|
|
|
|
|
|
### Declare:
|
|
|
|
flake.nix:
|
|
|
|
```nix
|
|
|
|
{
|
|
|
|
inputs.doom-emacs.url = "github:vlaci/nix-doom-emacs";
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
extern/default.nix:
|
2021-02-20 20:42:36 +01:00
|
|
|
```nix
|
|
|
|
{
|
|
|
|
hmModules = {
|
2021-02-21 22:44:57 +01:00
|
|
|
inherit doom-emacs;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Use:
|
|
|
|
users/nixos/default.nix:
|
|
|
|
```nix
|
|
|
|
{ hmModules, ... }:
|
|
|
|
{
|
|
|
|
home-manager.users.nixos = {
|
|
|
|
imports = [ hmModules.doom-emacs.hmModule ] ;
|
|
|
|
|
|
|
|
programs.doom-emacs.enable = true;
|
2021-02-20 20:42:36 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-02-18 02:31:33 +01:00
|
|
|
[extern]: https://github.com/divnix/devos/tree/core/extern/default.nix
|