From 091e1f5648824839a35b32379abfd9353893d3ef Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Sun, 21 Feb 2021 14:44:57 -0700 Subject: [PATCH] doc: demonstrace hmModules --- extern/README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/extern/README.md b/extern/README.md index 0ca99bb..f246fb2 100644 --- a/extern/README.md +++ b/extern/README.md @@ -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; }; } ```