pub-solar-os/extern
Timothy DeHerrera d51cd34fb7
subflakes: make first class citizens
Subflakes should provide their wares as outputs, so wire up the pkgs
flake to reflect that.

Due to the unstable nature of flakes, updating the root flake doesn't
currently update the subflake lock file. Therefore, add additional
logic to flk update script in order to do this behind the scenes.

Nix is now pulled in from the "nix" registry flake in order for users
to take advantage of improvements to the UI since its last update in
nixpkgs.
2021-03-14 21:27:58 -06:00
..
default.nix subflakes: make first class citizens 2021-03-14 21:27:58 -06:00
README.md doc: improve demonstration 2021-02-21 14:51:19 -07: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 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.

Home Manager

There is also an hmModules attribute set for pulling home-manager modules in from the outside world:

Declare:

flake.nix:

{
  inputs.doom-emacs.url = "github:vlaci/nix-doom-emacs";
}

extern/default.nix:

with inputs;
{
  hmModules = {
    doom-emacs = doom-emacs.hmModule;
  };
}

Use:

users/nixos/default.nix:

{ hmModules, ... }:
{
  home-manager.users.nixos = {
    imports = [ hmModules.doom-emacs ] ;

    programs.doom-emacs.enable = true;
  };
}