forked from extern/flakelight
Check HM useGlobalPkgs before propagating
The NixOS home-manager module only uses nixpkgs settings if useGlobalPkgs is false. If it is true, there is no need to propagate config (and propagating nixpkgs.config would cause an assertion).
This commit is contained in:
parent
a55ef90976
commit
c70ffe0ddd
@ -7,24 +7,27 @@
|
|||||||
|
|
||||||
{ lib, config, flakelight, moduleArgs, inputs, outputs, ... }:
|
{ lib, config, flakelight, moduleArgs, inputs, outputs, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) mapAttrs mkOption optionalAttrs;
|
inherit (lib) mapAttrs mkOption optional optionalAttrs;
|
||||||
inherit (flakelight) selectAttr;
|
inherit (flakelight) selectAttr;
|
||||||
inherit (flakelight.types) module;
|
inherit (flakelight.types) module;
|
||||||
|
flakeConfig = config;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.propagationModule = mkOption { type = module; internal = true; };
|
options.propagationModule = mkOption { type = module; internal = true; };
|
||||||
|
|
||||||
config.propagationModule =
|
config.propagationModule =
|
||||||
{ lib, pkgs, options, ... }:
|
{ lib, pkgs, options, config, ... }:
|
||||||
let inherit (pkgs.stdenv.hostPlatform) system; in {
|
let inherit (pkgs.stdenv.hostPlatform) system; in {
|
||||||
config = (optionalAttrs (options ? nixpkgs.overlays) {
|
config = (optionalAttrs (options ? nixpkgs.overlays) {
|
||||||
# Apply flakelight overlays to NixOS/home-manager configurations
|
# Apply flakelight overlays to NixOS/home-manager configurations
|
||||||
nixpkgs.overlays = lib.mkOrder 10
|
nixpkgs.overlays = lib.mkOrder 10
|
||||||
(config.withOverlays ++ [ config.packageOverlay ]);
|
(flakeConfig.withOverlays ++ [ flakeConfig.packageOverlay ]);
|
||||||
})
|
})
|
||||||
// (optionalAttrs (options ? home-manager.sharedModules) {
|
// (optionalAttrs (options ? home-manager.sharedModules) {
|
||||||
# Propagate module to home-manager when using its nixos module
|
# Propagate module to home-manager when using its nixos module
|
||||||
home-manager.sharedModules = [ config.propagationModule ];
|
home-manager.sharedModules =
|
||||||
|
optional (! config.home-manager.useGlobalPkgs)
|
||||||
|
[ flakeConfig.propagationModule ];
|
||||||
})
|
})
|
||||||
// {
|
// {
|
||||||
# Give access to flakelight module args under `flake` arg.
|
# Give access to flakelight module args under `flake` arg.
|
||||||
|
Loading…
Reference in New Issue
Block a user