summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroutfoxxed <outfoxxed@outfoxxed.me>2023-05-01 23:32:23 -0700
committerMihai Fufezan <fufexan@pm.me>2023-05-03 13:05:21 +0300
commit4fe5827598a2d573f0c2c4c5f7e5f19e980b11fd (patch)
tree51b2394c360fca02f1eebfbf5d56f3eac55e4646
parent2e28e88dfdca3d836c5dbedb916e0f629fc6a540 (diff)
Add plugin configuration to home manager module
-rw-r--r--nix/hm-module.nix14
1 files changed, 13 insertions, 1 deletions
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