diff --git a/API_GUIDE.md b/API_GUIDE.md index 3d58fd2..a92fb98 100644 --- a/API_GUIDE.md +++ b/API_GUIDE.md @@ -954,7 +954,8 @@ or a function that takes `moduleArgs` and returns one of the prior. When using a set of `nixpkgs.lib.nixosSystem` args, NixOS modules will have access to a `flake` module arg equivalent to `moduleArgs` plus `inputs'` and `outputs'`. Flakelight's pkgs attributes, `withOverlays`, and `packages` will -also be available in the NixOS instance's pkgs. +also be available in the NixOS instance's pkgs, and Flakelight's +`nixpkgs.config` will apply to it as well. When using the result of calling `nixpkgs.lib.nixosSystem`, the `config.propagationModule` value can be used as a NixOS module to gain the above diff --git a/builtinModules/propagationModule.nix b/builtinModules/propagationModule.nix index 6f49a4c..08ba59c 100644 --- a/builtinModules/propagationModule.nix +++ b/builtinModules/propagationModule.nix @@ -18,10 +18,16 @@ in config.propagationModule = { lib, pkgs, options, config, ... }: let inherit (pkgs.stdenv.hostPlatform) system; in { - config = (optionalAttrs (options ? nixpkgs.overlays) { - # Apply flakelight overlays to NixOS/home-manager configurations - nixpkgs.overlays = lib.mkOrder 10 - (flakeConfig.withOverlays ++ [ flakeConfig.packageOverlay ]); + config = (optionalAttrs (options ? nixpkgs) { + nixpkgs = (optionalAttrs (options ? nixpkgs.overlays) { + # Forward overlays to NixOS/home-manager configurations + overlays = lib.mkOrder 10 + (flakeConfig.withOverlays ++ [ flakeConfig.packageOverlay ]); + }) + // (optionalAttrs (options ? nixpkgs.config) { + # Forward nixpkgs.config to NixOS/home-manager configurations + inherit (flakeConfig.nixpkgs) config; + }); }) // (optionalAttrs (options ? home-manager.sharedModules) { # Propagate module to home-manager when using its nixos module