docs: include NixOS installation instructions in the README

This commit is contained in:
NotAShelf 2023-09-09 13:03:50 +03:00 committed by Stanisław Zagórowski
parent 11d8167adf
commit 1d8197c0a9

View file

@ -17,6 +17,7 @@ plugins = [
Then update via the `hyprload,update` dispatcher Then update via the `hyprload,update` dispatcher
## Manual installation ## Manual installation
1. Export the `HYPRLAND_HEADERS` variable to point to the root directory of the Hyprland repo 1. Export the `HYPRLAND_HEADERS` variable to point to the root directory of the Hyprland repo
- `export HYPRLAND_HEADERS="$HOME/repos/Hyprland"` - `export HYPRLAND_HEADERS="$HOME/repos/Hyprland"`
2. Compile 2. Compile
@ -24,9 +25,74 @@ Then update via the `hyprload,update` dispatcher
3. Add this line to the bottom of your hyprland config 3. Add this line to the bottom of your hyprland config
- `exec-once=hyprctl plugin load <ABSOLUTE PATH TO split-monitor-workspaces.so>` - `exec-once=hyprctl plugin load <ABSOLUTE PATH TO split-monitor-workspaces.so>`
## 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 # Usage
The plugin provides drop-in replacements for workspace-related commands The plugin provides drop-in replacements for workspace-related commands
| Normal | Replacement | | Normal | Replacement |
|-----------------------|-------------------------------| |-----------------------|-------------------------------|
| workspace | split-workspace | | workspace | split-workspace |