From 30ba8e7c75198783fc9af3b84e6d95482538ce4a Mon Sep 17 00:00:00 2001 From: benvonh Date: Fri, 3 Jan 2025 01:24:59 +1000 Subject: [PATCH] nix: Use lib.optionals for overlays in HM module --- nix/module.nix | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/nix/module.nix b/nix/module.nix index 12ca363..d2909d4 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -10,14 +10,15 @@ let package = if pkgs ? hyprpanel then pkgs.hyprpanel else abort '' - ****************************************** - * HyprPanel * - ****************************************** - * You didn't add the overlay! * - * * - * Either set 'overlay.enable = true' or * - * manually add it to 'nixpkgs.overlays'. * - ****************************************** + ******************************************************************************** + * HyprPanel * + *------------------------------------------------------------------------------* + * You didn't add the overlay! * + * * + * Either set 'overlay.enable = true' or manually add it to 'nixpkgs.overlays'. * + * If you use the 'nixosModule' for Home Manager and have 'useGlobalPkgs' set, * + * you will need to add the overlay yourself. * + ******************************************************************************** ''; # Shorthand lambda for self-documenting options under settings @@ -590,7 +591,8 @@ in in mkIf cfg.enable { - nixpkgs.overlays = if cfg.overlay.enable then [ self.overlay ] else null; + # nixpkgs.overlays = if cfg.overlay.enable then [ self.overlay ] else null; + nixpkgs.overlays = lib.optionals cfg.overlay.enable [ self.overlay ]; home.packages = [ package