From 20fc35c031c3d223a5536441e8460280118fd49c Mon Sep 17 00:00:00 2001 From: diniamo Date: Fri, 16 Aug 2024 14:43:48 +0200 Subject: [PATCH] hyprland: make package nullable --- modules/services/window-managers/hyprland.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 73602ec61..ce0368df4 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -56,7 +56,11 @@ in { ''; }; - package = lib.mkPackageOption pkgs "hyprland" { }; + package = lib.mkPackageOption pkgs "hyprland" { + nullable = true; + extraDescription = + "Set this to null if you use the NixOS module to install Hyprland."; + }; finalPackage = lib.mkOption { type = lib.types.package; @@ -220,10 +224,8 @@ in { "You have enabled hyprland.systemd.enable or listed plugins in hyprland.plugins but do not have any configuration in hyprland.settings or hyprland.extraConfig. This is almost certainly a mistake."; in lib.optional inconsistent warning; - home.packages = lib.concatLists [ - (lib.optional (cfg.package != null) cfg.finalPackage) - (lib.optional (cfg.xwayland.enable) pkgs.xwayland) - ]; + home.packages = lib.mkIf (cfg.package != null) + ([ cfg.finalPackage ] ++ lib.optional cfg.xwayland.enable pkgs.xwayland); xdg.configFile."hypr/hyprland.conf" = let shouldGenerate = cfg.systemd.enable || cfg.extraConfig != ""