Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions modules/lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@
}
];
};
isaacST08 = {
name = "Isaac Shiells Thomas";
email = "isaacst.nix@proton.me";
github = "isaacST08";
githubId = 106057977;
};
jack5079 = {
name = "Jack W.";
email = "nix@jack.cab";
Expand Down
14 changes: 14 additions & 0 deletions modules/misc/news/2026/03/2026-03-19_20-34-29.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ config, pkgs, ... }:
{
time = "2026-03-20T02:34:29+00:00";
condition = pkgs.stdenv.hostPlatform.isLinux;
# if behavior changed, explain how to restore previous behavior.
message = ''
A new module is available: 'services.wayle'.

Wayle is a fast, configurable desktop environment shell for Wayland
compositors. Built in Rust with Relm4 and focused on performance,
modularity, and a great user experience. A successor to HyprPanel without
the pain or dependency on Hyprland.
'';
}
139 changes: 139 additions & 0 deletions modules/services/wayle.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (builtins) elem;
inherit (lib.attrsets) recursiveUpdate;
inherit (lib) lists getExe';
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption mkOption mkPackageOption;

cfg = config.services.wayle;

tomlFormat = pkgs.formats.toml { };
in
{
meta.maintainers = with lib.maintainers; [
isaacST08
PerchunPak
];

options.services.wayle = {
enable = mkEnableOption "wayle shell";
package = mkPackageOption pkgs "wayle" { };

autoInstallDependencies = mkOption {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can test this option somehow

type = lib.types.bool;
default = true;
example = false;
description = ''
Whether to automatically install soft dependencies used by wayle that
will be required based on your config.
'';
};

settings = mkOption {
type = tomlFormat.type;
description = ''
Standard configuration options for wayle.
'';

default = { };

example =
lib.literalExpression
# nix
''
styling = {
theme-provider = "wayle";

palette = {
bg = "#16161e";
fg = "#c0caf5";
primary = "#7aa2f7";
};
};

bar = {
scale = 1;
location = "top";
rounding = "sm";

layout = {
monitor = "*";
left = ["clock"];
center = ["media"];
right = ["battery"];
};
};

modules.clock = {
format = "%H:%M";
icon-show = true;
label-show = true;
};
'';
};
};

config = mkIf cfg.enable (
let
# Define default settings.
settings = recursiveUpdate {
wallpaper.engine-enabled = false;
styling.theme-provider = "wayle";
} cfg.settings;
in
{
assertions = [
(lib.hm.assertions.assertPlatform "services.wayle" pkgs lib.platforms.linux)
];

home.packages = (
[ cfg.package ]
# Install the appropriate theme-provider, if set.
++ (lists.optional (
cfg.autoInstallDependencies
&& elem settings.styling.theme-provider [
"matugen"
"wallust"
"pywal"
]
) pkgs.${settings.styling.theme-provider})
);

# Main config file.
xdg.configFile."wayle/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "wayle-config" cfg.settings;
};

# Systemd service for main wayle shell.
systemd.user.services.wayle = {
Unit = {
Description = ''
Wayland Elements - A compositor agnostic shell with extensive customization
'';
Documentation = "https://github.com/wayle-rs/wayle";
PartOf = [ config.wayland.systemd.target ];
After = [ config.wayland.systemd.target ];
ConditionEnvironment = "WAYLAND_DISPLAY";
};
Service = {
ExecStart = "${getExe' cfg.package "wayle"} shell";
Restart = "on-failure";
};
Install = {
WantedBy = [ config.wayland.systemd.target ];
};
};

# Wallpaper-engine dependency.
services.awww.enable = mkIf (cfg.autoInstallDependencies && settings.wallpaper.engine-enabled) (
lib.mkDefault true
);
}
);
}
44 changes: 44 additions & 0 deletions tests/modules/services/wayle/basic-config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{ config, ... }:
{
services.wayle = {
enable = true;
package = config.lib.test.mkStubPackage { name = "wayle"; };

settings = {
styling = {
theme-provider = "wayle";

palette = {
bg = "#16161e";
fg = "#c0caf5";
primary = "#7aa2f7";
};
};

bar = {
scale = 1;
location = "top";
rounding = "sm";

layout = {
monitor = "*";
left = [ "clock" ];
center = [ "media" ];
right = [ "battery" ];
};
};

modules.clock = {
format = "%H:%M";
icon-show = true;
label-show = true;
};
};
};

nmt.script = ''
assertFileContent \
"home-files/.config/wayle/config.toml" \
${./basic-config.toml}
'';
}
23 changes: 23 additions & 0 deletions tests/modules/services/wayle/basic-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[bar]
location = "top"
rounding = "sm"
scale = 1

[bar.layout]
center = ["media"]
left = ["clock"]
monitor = "*"
right = ["battery"]

[modules.clock]
format = "%H:%M"
icon-show = true
label-show = true

[styling]
theme-provider = "wayle"

[styling.palette]
bg = "#16161e"
fg = "#c0caf5"
primary = "#7aa2f7"
5 changes: 5 additions & 0 deletions tests/modules/services/wayle/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ lib, pkgs, ... }:

lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
wayle-basic-config = ./basic-config.nix;
}