From 5a3c1449194aa70d5eacbd902fa99cc1b2910a30 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Wed, 3 May 2023 02:23:41 -0700 Subject: [PATCH] Add warning about setting hyprland config with home manager --- nix/hm-module.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nix/hm-module.nix b/nix/hm-module.nix index 10b08ab4..db8e544e 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -116,6 +116,13 @@ in { }; config = lib.mkIf cfg.enable { + warnings = + if (cfg.systemdIntegration || cfg.plugins != []) && cfg.extraConfig == null then + [ ''You have enabled hyprland.systemdIntegration or listed plugins in hyprland.plugins. + Your hyprland config will be linked by home manager. + Set hyprland.extraConfig or unset hyprland.systemdIntegration and hyprland.plugins to remove this warning.'' ] + else []; + home.packages = lib.optional (cfg.package != null) cfg.package ++ lib.optional cfg.xwayland.enable pkgs.xwayland; @@ -131,7 +138,7 @@ in { + lib.concatStrings (builtins.map (entry: let plugin = if lib.types.package.check entry then "${entry}/lib/lib${entry.pname}.so" else entry; in "plugin = ${plugin}\n") cfg.plugins) - + cfg.extraConfig; + + (if cfg.extraConfig != null then cfg.extraConfig else ""); onChange = let hyprlandPackage =