From 1d8197c0a914bbad40ab05af923560415bcf6052 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 9 Sep 2023 13:03:50 +0300 Subject: [PATCH] docs: include NixOS installation instructions in the README --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/README.md b/README.md index aa52973..a9cfe26 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ plugins = [ Then update via the `hyprload,update` dispatcher ## Manual installation + 1. Export the `HYPRLAND_HEADERS` variable to point to the root directory of the Hyprland repo - `export HYPRLAND_HEADERS="$HOME/repos/Hyprland"` 2. Compile @@ -24,9 +25,74 @@ Then update via the `hyprload,update` dispatcher 3. Add this line to the bottom of your hyprland config - `exec-once=hyprctl plugin load ` +## NixOS installation + +With flakes enabled, a sample installation will look like this: + +```nix +# flake.nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + hyprland.url = "github:hyprwm/Hyprland"; + split-monitor-workspaces = { + url = "github:Duckonaut/split-monitor-workspaces"; + inputs.hyprland.follows = "hyprland"; # <- make sure this line is present for the plugin to work as intended + }; + }; + + outputs = { + self, + nixpkgs, + home-manager, + split-monitor-workspaces, + ... + }: let + system = "x86_64-linux"; + # ↑ Swap it for your system if needed + pkgs = nixpkgs.legacyPackages.${system}; + in { + nixosConfigurations = { + yourHostname = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + # ... + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.yourUsername = { + wayland.windowManager.hyprland = { + # ... + plugins = [ + split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces + ]; + # ... + }; + }; + }; + } + ]; + # ... + }; + }; + }; +} +``` + +You will need to have home-manager installed and configured. You use `wayland.windowManager.hyprland.plugins = [];` to add the plugin. The home-manager +module will handle the rest. # Usage + The plugin provides drop-in replacements for workspace-related commands + | Normal | Replacement | |-----------------------|-------------------------------| | workspace | split-workspace |