mirror of
https://github.com/nix-community/flakelight.git
synced 2024-11-21 23:13:09 +01:00
Propagate nixpkgs.config to NixOS and HM
This commit is contained in:
parent
c70ffe0ddd
commit
fb530e878f
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user