2024-06-23 01:46:01 +03:00
|
|
|
---
|
|
|
|
|
title: Plugins
|
2025-07-29 22:08:01 +02:00
|
|
|
weight: 6
|
2024-06-23 01:46:01 +03:00
|
|
|
---
|
|
|
|
|
|
2025-07-29 22:08:01 +02:00
|
|
|
Hyprland plugins are managed differently on Nix than on other distros.
|
|
|
|
|
The most notable change is that `hyprpm` is unsupported, but we have our own way of
|
2025-10-05 14:05:51 +03:00
|
|
|
building and managing plugins.
|
2024-06-23 01:46:01 +03:00
|
|
|
|
2025-10-29 20:52:11 +01:00
|
|
|
> [!WARNING]
|
|
|
|
|
> Using plugins using the syntax below requires you to be using Hyprland through
|
|
|
|
|
> the [Home Manager module](../Hyprland-on-Home-Manager) or the
|
|
|
|
|
> [upstream NixOS module](../Hyprland-on-NixOS#upstream-module).
|
2024-09-10 17:16:01 +03:00
|
|
|
|
2024-06-23 01:46:01 +03:00
|
|
|
## Using plugins from Nixpkgs
|
|
|
|
|
|
|
|
|
|
In Nixpkgs, there are Hyprland plugins packaged for the Hyprland version in
|
|
|
|
|
Nixpkgs. You can use them like this:
|
|
|
|
|
|
2024-11-06 22:55:14 +02:00
|
|
|
```nix {filename="home.nix"}
|
2024-06-23 01:46:01 +03:00
|
|
|
{pkgs, ...}: {
|
|
|
|
|
wayland.windowManager.hyprland.plugins = [
|
|
|
|
|
pkgs.hyprlandPlugins.<plugin>
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You can find which plugins are included using
|
2024-11-09 16:08:33 +01:00
|
|
|
`nix search nixpkgs#hyprlandPlugins ^`.
|
2024-06-23 01:46:01 +03:00
|
|
|
|
|
|
|
|
## hyprland-plugins
|
|
|
|
|
|
|
|
|
|
Official plugins made/maintained by vaxry.
|
|
|
|
|
|
2025-07-29 22:08:01 +02:00
|
|
|
To use these plugins, it is recommended to be already using the Hyprland
|
2024-06-23 01:46:01 +03:00
|
|
|
flake, and **not** the Nixpkgs version.
|
|
|
|
|
|
|
|
|
|
First, add the flake to your flake inputs:
|
|
|
|
|
|
2024-11-06 22:55:14 +02:00
|
|
|
```nix {filename="flake.nix"}
|
2024-06-23 01:46:01 +03:00
|
|
|
{
|
|
|
|
|
inputs = {
|
2024-10-10 18:13:46 +03:00
|
|
|
hyprland.url = "github:hyprwm/Hyprland";
|
2024-06-23 01:46:01 +03:00
|
|
|
|
|
|
|
|
hyprland-plugins = {
|
|
|
|
|
url = "github:hyprwm/hyprland-plugins";
|
|
|
|
|
inputs.hyprland.follows = "hyprland";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# ...
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `inputs.hyprland.follows` line makes hyprland-plugins use the exact Hyprland
|
2025-07-29 22:08:01 +02:00
|
|
|
revision you have locked.
|
|
|
|
|
This means there aren't any version mismatches, as long as you update both inputs at once.
|
2024-06-23 01:46:01 +03:00
|
|
|
|
|
|
|
|
The next step is adding the plugins to Hyprland:
|
|
|
|
|
|
2024-11-06 22:55:14 +02:00
|
|
|
```nix {filename="home.nix"}
|
2024-06-23 01:46:01 +03:00
|
|
|
{inputs, pkgs, ...}: {
|
|
|
|
|
wayland.windowManager.hyprland = {
|
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
|
|
plugins = [
|
|
|
|
|
inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.<plugin>
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Building plugins with Nix
|
|
|
|
|
|
|
|
|
|
The plugins inside Nixpkgs, as well as the ones in `hyprland-plugins`, are built
|
2025-07-29 22:08:01 +02:00
|
|
|
using a general function: `mkHyprlandPlugin`.
|
|
|
|
|
Any plugin can be made to work with it. The general usage is presented below, exemplified through hy3's
|
2024-06-23 01:46:01 +03:00
|
|
|
derivation:
|
|
|
|
|
|
2024-11-06 22:55:42 +02:00
|
|
|
```nix {filename="plugin.nix"}
|
|
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
cmake,
|
|
|
|
|
hyprland,
|
|
|
|
|
hyprlandPlugins,
|
|
|
|
|
}:
|
2025-10-05 14:05:51 +03:00
|
|
|
hyprlandPlugins.mkHyprlandPlugin (finalAttrs: {
|
2024-11-06 22:55:42 +02:00
|
|
|
pluginName = "hy3";
|
|
|
|
|
version = "0.39.1";
|
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "outfoxxed";
|
|
|
|
|
repo = "hy3";
|
2025-10-05 14:05:51 +03:00
|
|
|
rev = "hl${finalAttrs.version}";
|
2024-11-06 22:55:42 +02:00
|
|
|
hash = "sha256-PqVld+oFziSt7VZTNBomPyboaMEAIkerPQFwNJL/Wjw=";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# any nativeBuildInputs required for the plugin
|
|
|
|
|
nativeBuildInputs = [cmake];
|
|
|
|
|
|
|
|
|
|
# set any buildInputs that are not already included in Hyprland
|
|
|
|
|
# by default, Hyprland and its dependencies are included
|
|
|
|
|
buildInputs = [];
|
|
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
|
homepage = "https://github.com/outfoxxed/hy3";
|
|
|
|
|
description = "Hyprland plugin for an i3 / sway like manual tiling layout";
|
|
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
|
};
|
2025-10-05 14:05:51 +03:00
|
|
|
})
|
2024-11-06 22:55:42 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```nix {filename="home.nix"}
|
2024-06-23 01:46:01 +03:00
|
|
|
{pkgs, ...}: {
|
2024-11-06 22:55:42 +02:00
|
|
|
wayland.windowManager.hyprland.plugins = [
|
|
|
|
|
(pkgs.callPackage ./plugin.nix {})
|
|
|
|
|
];
|
2024-06-23 01:46:01 +03:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
In a similar manner to `stdenv.mkDerivation`, `mkHyprlandPlugin` takes an
|
|
|
|
|
attrset with mostly the same options as `mkDerivation`, as it is essentially a
|
|
|
|
|
wrapper around it.
|