e41c3cb2562456f30d406d2ebe6217c41f30a615

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

Message

Update readme with new nix instructions

Also simplify hyprload example

Diff

 1diff --git a/README.md b/README.md
 2index 45331b8621abfdcf24099e3280dcb21b3f13664b..4eaa3c495844b2b4d3c7246f5c928422fbb5a77b 100644
 3--- a/README.md
 4+++ b/README.md
 5@@ -41,7 +41,62 @@ You can use `hy3:makegroup` to create a new split.
 6 ## Installing
 7 
 8 ### Nix
 9-Under nix, use the provided devShell, then go to [Manual Installation](#manual)
10+#### Using the home-manager module
11+Assuming you use hyprland's home manager module, you can easily integrate hy3, as hy3 provides a home manager module that exposes the `wayland.windowManager.hyprland.plugins.hy3.enable` option.
12+
13+```nix
14+# flake.nix
15+
16+{
17+  inputs = {
18+    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
19+
20+    home-manager = {
21+      url = "github:nix-community/home-manager";
22+      inputs.nixpkgs.follows = "nixpkgs";
23+    };
24+
25+    hyprland.url = "github:hyprwm/Hyprland";
26+
27+    hy3 = {
28+      url = "github:outfoxxed/hy3";
29+      inputs.hyprland.follows = "hyprland";
30+    };
31+  };
32+
33+  outputs = { nixpkgs, home-manager, hyprland, hy3, ... }: {
34+    homeConfigurations."user@hostname" = home-manager.lib.homeManagerConfiguration {
35+      pkgs = nixpkgs.legacyPackages.x86_64-linux;
36+
37+      modules = [
38+        hyprland.homeManagerModules.default
39+        hy3.homeManagerModules.default
40+
41+        {
42+          wayland.windowManager.hyprland = {
43+            enable = true;
44+            plugins.hy3.enable = true;
45+          };
46+        }
47+      ];
48+    };
49+  };
50+}
51+```
52+
53+#### Manually (Nix)
54+hy3's binary is availible as `${hy3.packages.<system>.hy3}/lib/libhy3.so`, so you can also
55+directly use it in your hyprland config like so:
56+
57+```nix
58+# ...
59+wayland.windowManager.hyprland = {
60+  # ...
61+  extraConfig = ''
62+    exec-once = hyprctl plugin load ${hy3.packages.x86_64-linux.hy3}/lib/libhy3.so
63+  '';
64+};
65+```
66 
67 ### [Hyprload](https://github.com/Duckonaut/hyprload)
68 Add an entry to your hyprload.toml like so:
69@@ -49,19 +104,18 @@ Add an entry to your hyprload.toml like so:
70 ```toml
71 plugins = [
72   # ...
73-  { git = "https://github.com/outfoxxed/hy3", branch = "master", name = "hy3" },
74+  "outfoxxed/hy3",
75   # ...
76 ]
77 ```
78 
79 ### Manual
80-First export `HYPRLAND_HEADERS`, then run the following commands:
81+Install hyprland, then run the following commands:
82 
83 ```sh
84 cmake -DCMAKE_BUILD_TYPE=Debug -B build
85 cmake --build build
86 ```
87 
88-> **Note**: Please use a debug build as debugging a backtrace from a release build is much more difficult if you need to report an error.
89-
90-The plugin will be located at `build/libhy3.so`.
91+The plugin will be located at `build/libhy3.so`, and you can load it normally
92+(See [the hyprland wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/#installing--using-plugins) for details.)