diff --git a/README.md b/README.md index f5f2200b..0a96017d 100644 --- a/README.md +++ b/README.md @@ -130,8 +130,33 @@ in } ``` -If your configuration already provides `pkgs`, reuse it instead of importing Nixpkgs again. For -NixOS or nix-darwin, select the corresponding module just as in the flake examples above: +If your configuration already has a package set available independently of module arguments, pass +it as `pkgs` to reuse its Nixpkgs configuration and overlays. + +Home Manager's usual `pkgs` module argument cannot be used to calculate that module's `imports`; it +is provided through the module graph after imports are collected. When your pinned inputs are +available through `home-manager.extraSpecialArgs`, pass the pinned Nixpkgs source instead. With +[Nixtamal](https://nixtamal.toast.al/): + +```nix +# `nixtamal` is provided through `home-manager.extraSpecialArgs`. +{ nixtamal, ... }: + +let + nixcord = import nixtamal.nixcord { + nixpkgs = nixtamal.nixpkgs; + }; +in +{ + imports = [ nixcord.homeModules.nixcord ]; +} +``` + +This gives `nixcord.packages` a separate package set from the supplied Nixpkgs source; it does not +inherit the Home Manager package set's configuration or overlays. An empty argument set also works, +but uses Nixcord's bundled Nixpkgs pin for package outputs. + +For NixOS or nix-darwin, select the corresponding module just as in the flake examples above: ```nix # NixOS