diff --git a/doc/src/installation.md b/doc/src/installation.md index 74785631d..49c3fe47e 100644 --- a/doc/src/installation.md +++ b/doc/src/installation.md @@ -51,10 +51,10 @@ your existing configuration, so you don't need to run any extra commands when you rebuild, and the theme you set in NixOS will automatically be used for Home Manager too. -When Stylix is installed to a NixOS configuration, it will automatically set up -its Home Manager modules if it detects that Home Manager is available. You can -theoretically use it without installing Home Manager, however most features will -be unavailable. +When Stylix is installed and enabled in a NixOS configuration, it will +automatically set up its Home Manager modules if it detects that Home Manager +is available. You can theoretically use it without installing Home Manager, +however most features will be unavailable. ## nix-darwin diff --git a/stylix/home-manager-integration.nix b/stylix/home-manager-integration.nix index 4ea4de6f7..d67c540a8 100644 --- a/stylix/home-manager-integration.nix +++ b/stylix/home-manager-integration.nix @@ -210,20 +210,22 @@ in }; }; - config = lib.optionalAttrs (options ? home-manager) ( - lib.mkMerge [ - (lib.mkIf config.stylix.homeManagerIntegration.autoImport { - home-manager.sharedModules = - [ - config.stylix.homeManagerIntegration.module - ] - ++ (lib.optionals config.stylix.homeManagerIntegration.followSystem copyModules); - }) - (lib.mkIf config.home-manager.useGlobalPkgs { - home-manager.sharedModules = lib.singleton { - config.stylix.overlays.enable = false; - }; - }) - ] + config = lib.mkIf config.stylix.enable ( + lib.optionalAttrs (options ? home-manager) ( + lib.mkMerge [ + (lib.mkIf config.stylix.homeManagerIntegration.autoImport { + home-manager.sharedModules = + [ + config.stylix.homeManagerIntegration.module + ] + ++ (lib.optionals config.stylix.homeManagerIntegration.followSystem copyModules); + }) + (lib.mkIf config.home-manager.useGlobalPkgs { + home-manager.sharedModules = lib.singleton { + config.stylix.overlays.enable = false; + }; + }) + ] + ) ); }