From 4fe5827598a2d573f0c2c4c5f7e5f19e980b11fd Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Mon, 1 May 2023 23:32:23 -0700 Subject: [PATCH] Add plugin configuration to home manager module --- nix/hm-module.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nix/hm-module.nix b/nix/hm-module.nix index 577bf5ca..10b08ab4 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -51,6 +51,15 @@ in { ''; }; + plugins = lib.mkOption { + type = with lib.types; listOf (either package path); + default = []; + description = lib.mdDoc '' + List of hyprlad plugins to use. Can either be packages or + absolute plugin paths. + ''; + }; + systemdIntegration = lib.mkOption { type = lib.types.bool; default = pkgs.stdenv.isLinux; @@ -114,11 +123,14 @@ in { home.sessionVariables = lib.mkIf cfg.recommendedEnvironment {NIXOS_OZONE_WL = "1";}; - xdg.configFile."hypr/hyprland.conf" = lib.mkIf (cfg.extraConfig != null) { + xdg.configFile."hypr/hyprland.conf" = lib.mkIf (cfg.systemdIntegration || cfg.extraConfig != null || cfg.plugins != []) { text = (lib.optionalString cfg.systemdIntegration '' exec-once=${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && systemctl --user start hyprland-session.target '') + + 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; onChange = let