3618e186aa4e6501fbd76d384bc383108de0b73d

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

Add home-manager module

Diff

 1diff --git a/flake.nix b/flake.nix
 2index 211d01934206390410acff3250a61efb06403185..f702f3da9631c22750c092a431bf4a0aa494fa81 100644
 3--- a/flake.nix
 4+++ b/flake.nix
 5@@ -3,10 +3,10 @@
 6     hyprland.url = "github:hyprwm/Hyprland";
 7   };
 8 
 9-  outputs = { hyprland, ... }: let
10+  outputs = { self, hyprland, ... }: let
11     inherit (hyprland.inputs) nixpkgs;
12     hyprlandSystems = fn: nixpkgs.lib.genAttrs (builtins.attrNames hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system});
13-  in rec {
14+  in {
15     packages = hyprlandSystems (system: pkgs: rec {
16       hy3 = pkgs.gcc12Stdenv.mkDerivation {
17         pname = "hy3";
18@@ -39,8 +39,23 @@
19           bear
20         ];
21 
22-        inputsFrom = [ packages.${system}.hy3 ];
23+        inputsFrom = [ self.packages.${system}.hy3 ];
24       };
25     });
26+
27+    homeManagerModules.default = { config, lib, pkgs, ... }: let
28+      cfg = config.wayland.windowManager.hyprland.plugins.hy3;
29+      hy3Package = self.packages.${pkgs.hostPlatform.system}.default;
30+    in {
31+      options.wayland.windowManager.hyprland.plugins.hy3 = {
32+        enable = lib.mkEnableOption "hy3 plugin";
33+      };
34+
35+      config = lib.mkIf cfg.enable {
36+        wayland.windowManager.hyprland.extraConfig = ''
37+          exec-once = hyprctl plugin load ${hy3Package}/lib/libhy3.so && hyprctl reload
38+        '';
39+      };
40+    };
41   };
42 }