push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.dwl;
in
{
options.programs.dwl = {
enable = lib.mkEnableOption ''
Dwl is a compact, hackable compositor for Wayland based on wlroots.
You can manually launch Dwl by executing "exec dwl" on a TTY.
'';
package = lib.mkPackageOption pkgs "dwl" {
example = ''
# Lets apply bar patch from:
# https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar
(pkgs.dwl.override {
configH = ./dwl-config.h;
}).overrideAttrs (oldAttrs: {
buildInputs =
oldAttrs.buildInputs or []
++ [
pkgs.libdrm
pkgs.fcft
];
patches = oldAttrs.patches or [] ++ [
./bar-0.7.patch
];
});
'';
};
extraSessionCommands = lib.mkOption {
default = "";
type = lib.types.lines;
description = ''
Shell commands executed just before dwl is started.
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
# Create systemd target for dwl session
systemd.user.targets.dwl-session = {
description = "dwl compositor session";
documentation = [ "man:systemd.special(7)" ];
bindsTo = [ "graphical-session.target" ];
wants = [ "graphical-session-pre.target" ];
after = [ "graphical-session-pre.target" ];
};
# Create wrapper script for dwl
environment.etc."xdg/dwl-session" = {
text = ''
#!${pkgs.runtimeShell}
# Import environment variables
${cfg.extraSessionCommands}
# Setup systemd user environment
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY
systemctl --user start dwl-session.target
# Start dwl
exec ${lib.getExe cfg.package}
'';
mode = "0755"; # Make it executable
};
# Create desktop entry for display managers
services.displayManager.sessionPackages =
let
dwlDesktopFile = pkgs.writeTextFile {
name = "dwl-desktop-entry";
destination = "/share/wayland-sessions/dwl.desktop";
text = ''
[Desktop Entry]
Name=dwl
Comment=Dynamic window manager for Wayland
Exec=/etc/xdg/dwl-session
Type=Application
'';
};
dwlSession = pkgs.symlinkJoin {
name = "dwl-session";
paths = [ dwlDesktopFile ];
passthru.providedSessions = [ "dwl" ];
};
in
[ dwlSession ];
# Configure XDG portal for dwl (minimal configuration)
xdg.portal.config.dwl.default = lib.mkDefault [
"wlr"
"gtk"
];
};
meta.maintainers = with lib.maintainers; [ gurjaka ];
}

View File

@@ -0,0 +1,78 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.gtklock;
configFormat = pkgs.formats.ini {
listToValue = builtins.concatStringsSep ";";
};
inherit (lib)
types
mkOption
mkEnableOption
mkPackageOption
;
in
{
options.programs.gtklock = {
enable = mkEnableOption "gtklock, a GTK-based lockscreen for Wayland";
package = mkPackageOption pkgs "gtklock" { };
config = mkOption {
type = configFormat.type;
example = lib.literalExpression ''
{
main = {
idle-hide = true;
idle-timeout = 10;
};
}'';
description = ''
Configuration for gtklock.
See [`gtklock(1)`](https://github.com/jovanlanik/gtklock/blob/master/man/gtklock.1.scd) man page for details.
'';
};
style = mkOption {
type = with types; nullOr lines;
default = null;
description = ''
CSS Stylesheet for gtklock.
See [gtklock's wiki](https://github.com/jovanlanik/gtklock/wiki#Styling) for details.
'';
};
modules = mkOption {
type = with types; listOf package;
default = [ ];
example = lib.literalExpression ''
with pkgs; [
gtklock-playerctl-module
gtklock-powerbar-module
gtklock-userinfo-module
]'';
description = "gtklock modules to load.";
};
};
config = lib.mkIf cfg.enable {
programs.gtklock.config.main = {
style = lib.mkIf (cfg.style != null) "${pkgs.writeText "style.css" cfg.style}";
modules = lib.mkIf (cfg.modules != [ ]) (
map (pkg: "${pkg}/lib/gtklock/${lib.removePrefix "gtklock-" pkg.pname}.so") cfg.modules
);
};
environment.etc."xdg/gtklock/config.ini".source = configFormat.generate "config.ini" cfg.config;
environment.systemPackages = [ cfg.package ];
security.pam.services.gtklock = { };
};
}

View File

@@ -0,0 +1,143 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.hyprland;
wayland-lib = import ./lib.nix { inherit lib; };
in
{
options.programs.hyprland = {
enable = lib.mkEnableOption ''
Hyprland, the dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
You can manually launch Hyprland by executing {command}`Hyprland` on a TTY.
A configuration file will be generated in {file}`~/.config/hypr/hyprland.conf`.
See <https://wiki.hyprland.org> for more information'';
package =
lib.mkPackageOption pkgs "hyprland" {
extraDescription = ''
If the package is not overridable with `enableXWayland`, then the module option
{option}`xwayland` will have no effect.
'';
}
// {
apply =
p:
wayland-lib.genFinalPackage p {
enableXWayland = cfg.xwayland.enable;
};
};
portalPackage =
lib.mkPackageOption pkgs "xdg-desktop-portal-hyprland" {
extraDescription = ''
If the package is not overridable with `hyprland`, then the Hyprland package
used by the portal may differ from the one set in the module option {option}`package`.
'';
}
// {
apply =
p:
wayland-lib.genFinalPackage p {
hyprland = cfg.package;
};
};
xwayland.enable = lib.mkEnableOption "XWayland" // {
default = true;
};
withUWSM = lib.mkEnableOption null // {
description = ''
Launch Hyprland with the UWSM (Universal Wayland Session Manager) session manager.
This has improved systemd support and is recommended for most users.
This automatically starts appropiate targets like `graphical-session.target`,
and `wayland-session@Hyprland.target`.
::: {.note}
Some changes may need to be made to Hyprland configs depending on your setup, see
[Hyprland wiki](https://wiki.hyprland.org/Useful-Utilities/Systemd-start/#uwsm).
:::
'';
};
systemd.setPath.enable = lib.mkEnableOption null // {
default = lib.versionOlder cfg.package.version "0.41.2";
defaultText = lib.literalExpression ''lib.versionOlder cfg.package.version "0.41.2"'';
example = false;
description = ''
Set environment path of systemd to include the current system's bin directory.
This is needed in Hyprland setups, where opening links in applications do not work.
Enabled by default for Hyprland versions older than 0.41.2.
'';
};
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
environment.systemPackages = [ cfg.package ];
xdg.portal = {
enable = true;
extraPortals = [ cfg.portalPackage ];
configPackages = lib.mkDefault [ cfg.package ];
};
systemd = lib.mkIf cfg.systemd.setPath.enable {
user.extraConfig = ''
DefaultEnvironment="PATH=/run/wrappers/bin:/etc/profiles/per-user/%u/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:$PATH"
'';
};
}
(lib.mkIf (cfg.withUWSM) {
programs.uwsm.enable = true;
# Configure UWSM to launch Hyprland from a display manager like SDDM
programs.uwsm.waylandCompositors = {
hyprland = {
prettyName = "Hyprland";
comment = "Hyprland compositor managed by UWSM";
binPath = "/run/current-system/sw/bin/Hyprland";
};
};
})
(lib.mkIf (!cfg.withUWSM) {
# To make a vanilla Hyprland session available in DM
services.displayManager.sessionPackages = [ cfg.package ];
})
(import ./wayland-session.nix {
inherit lib pkgs;
enableXWayland = cfg.xwayland.enable;
enableWlrPortal = false; # Hyprland has its own portal, wlr is not needed
})
]
);
imports = [
(lib.mkRemovedOptionModule [
"programs"
"hyprland"
"xwayland"
"hidpi"
] "XWayland patches are deprecated. Refer to https://wiki.hyprland.org/Configuring/XWayland")
(lib.mkRemovedOptionModule [
"programs"
"hyprland"
"enableNvidiaPatches"
] "Nvidia patches are no longer needed")
(lib.mkRemovedOptionModule [
"programs"
"hyprland"
"nvidiaPatches"
] "Nvidia patches are no longer needed")
];
meta.maintainers = lib.teams.hyprland.members;
}

View File

@@ -0,0 +1,30 @@
{
lib,
pkgs,
config,
...
}:
let
cfg = config.programs.hyprlock;
in
{
options.programs.hyprlock = {
enable = lib.mkEnableOption "hyprlock, Hyprland's GPU-accelerated screen locking utility";
package = lib.mkPackageOption pkgs "hyprlock" { };
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
cfg.package
];
# Hyprlock needs Hypridle systemd service to be running to detect idle time
services.hypridle.enable = true;
# Hyprlock needs PAM access to authenticate, else it fallbacks to su
security.pam.services.hyprlock = { };
};
meta.maintainers = lib.teams.hyprland.members;
}

View File

@@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.labwc;
in
{
meta.maintainers = [ ];
options.programs.labwc = {
enable = lib.mkEnableOption "labwc";
package = lib.mkPackageOption pkgs "labwc" { };
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
environment.systemPackages = [ cfg.package ];
xdg.portal.config.wlroots.default = lib.mkDefault [
"wlr"
"gtk"
];
# To make a labwc session available for certain DMs like SDDM
services.displayManager.sessionPackages = [ cfg.package ];
}
(import ./wayland-session.nix { inherit lib pkgs; })
]
);
}

View File

@@ -0,0 +1,13 @@
{ lib }:
{
genFinalPackage =
pkg: args:
let
expectedArgs = lib.naturalSort (lib.attrNames args);
existingArgs =
with lib;
naturalSort (intersectLists expectedArgs (attrNames (functionArgs pkg.override)));
in
if existingArgs != expectedArgs then pkg else pkg.override args;
}

View File

@@ -0,0 +1,44 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.programs.wayland.miracle-wm;
in
{
options.programs.wayland.miracle-wm = {
enable = lib.mkEnableOption ''
miracle-wm, a tiling Mir based Wayland compositor. You can manually launch miracle-wm by
executing "exec miracle-wm" on a TTY, or launch it from a display manager.
Consult the USERGUIDE.md at <https://github.com/mattkae/miracle-wm> for information on
how to use & configure it
'';
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
environment = {
systemPackages = [ pkgs.miracle-wm ];
};
# To make the miracle-wm session available if a display manager like SDDM is enabled:
services.displayManager.sessionPackages = [ pkgs.miracle-wm ];
}
(import ./wayland-session.nix {
inherit lib pkgs;
# Hardcoded path in Mir, not really possible to disable
enableXWayland = true;
# No portal support yet: https://github.com/mattkae/miracle-wm/issues/164
enableWlrPortal = false;
enableGtkPortal = false;
})
]
);
meta.maintainers = with lib.maintainers; [ OPNA2608 ];
}

View File

@@ -0,0 +1,55 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.niri;
in
{
options.programs.niri = {
enable = lib.mkEnableOption "Niri, a scrollable-tiling Wayland compositor";
package = lib.mkPackageOption pkgs "niri" { };
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
environment.systemPackages = [ cfg.package ];
services = {
displayManager.sessionPackages = [ cfg.package ];
# Recommended by upstream
# https://github.com/YaLTeR/niri/wiki/Important-Software#portals
gnome.gnome-keyring.enable = lib.mkDefault true;
};
systemd.packages = [ cfg.package ];
xdg.portal = {
enable = lib.mkDefault true;
configPackages = [ cfg.package ];
# Recommended by upstream, required for screencast support
# https://github.com/YaLTeR/niri/wiki/Important-Software#portals
extraPortals = [ pkgs.xdg-desktop-portal-gnome ];
};
}
(import ./wayland-session.nix {
inherit lib pkgs;
enableWlrPortal = false;
enableXWayland = false;
})
]
);
meta.maintainers = with lib.maintainers; [
getchoo
sodiboo
];
}

View File

@@ -0,0 +1,103 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.river-classic;
wayland-lib = import ./lib.nix { inherit lib; };
in
{
options.programs.river-classic = {
enable = lib.mkEnableOption "river-classic, a dynamic tiling Wayland compositor";
package =
lib.mkPackageOption pkgs "river-classic" {
nullable = true;
extraDescription = ''
If the package is not overridable with `xwaylandSupport`, then the module option
{option}`xwayland` will have no effect.
Set to `null` to not add any River package to your path.
This should be done if you want to use the Home Manager River module to install River.
'';
}
// {
apply =
p:
if p == null then
null
else
wayland-lib.genFinalPackage p {
xwaylandSupport = cfg.xwayland.enable;
};
};
xwayland.enable = lib.mkEnableOption "XWayland" // {
default = true;
};
extraPackages = lib.mkOption {
type = with lib.types; listOf package;
default = with pkgs; [
swaylock
foot
dmenu
];
defaultText = lib.literalExpression ''
with pkgs; [ swaylock foot dmenu ];
'';
example = lib.literalExpression ''
with pkgs; [ termite rofi light ]
'';
description = ''
Extra packages to be installed system wide. See
[Common X11 apps used on i3 with Wayland alternatives](https://github.com/swaywm/sway/wiki/i3-Migration-Guide#common-x11-apps-used-on-i3-with-wayland-alternatives)
for a list of useful software.
'';
};
};
imports = [
(lib.mkRenamedOptionModule [ "programs" "river" "enable" ] [ "programs" "river-classic" "enable" ])
(lib.mkRenamedOptionModule
[ "programs" "river" "package" ]
[ "programs" "river-classic" "package" ]
)
(lib.mkRenamedOptionModule
[ "programs" "river" "xwayland" "enable" ]
[ "programs" "river-classic" "xwayland" "enable" ]
)
(lib.mkRenamedOptionModule
[ "programs" "river" "extraPackages" ]
[ "programs" "river-classic" "extraPackages" ]
)
];
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
environment.systemPackages = lib.optional (cfg.package != null) cfg.package ++ cfg.extraPackages;
# To make a river session available if a display manager like SDDM is enabled:
services.displayManager.sessionPackages = lib.optional (cfg.package != null) cfg.package;
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050913
xdg.portal.config.river.default = lib.mkDefault [
"wlr"
"gtk"
];
}
(import ./wayland-session.nix {
inherit lib pkgs;
enableXWayland = cfg.xwayland.enable;
})
]
);
meta.maintainers = with lib.maintainers; [ GaetanLepage ];
}

View File

@@ -0,0 +1,208 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.sway;
wayland-lib = import ./lib.nix { inherit lib; };
in
{
options.programs.sway = {
enable = lib.mkEnableOption ''
Sway, the i3-compatible tiling Wayland compositor. You can manually launch
Sway by executing "exec sway" on a TTY. Copy /etc/sway/config to
~/.config/sway/config to modify the default configuration. See
<https://github.com/swaywm/sway/wiki> and
"man 5 sway" for more information'';
package =
lib.mkPackageOption pkgs "sway" {
nullable = true;
extraDescription = ''
If the package is not overridable with `extraSessionCommands`, `extraOptions`,
`withBaseWrapper`, `withGtkWrapper`, `enableXWayland` and `isNixOS`,
then the module options {option}`wrapperFeatures`, {option}`extraSessionCommands`,
{option}`extraOptions` and {option}`xwayland` will have no effect.
Set to `null` to not add any Sway package to your path.
This should be done if you want to use the Home Manager Sway module to install Sway.
'';
}
// {
apply =
p:
if p == null then
null
else
wayland-lib.genFinalPackage p {
extraSessionCommands = cfg.extraSessionCommands;
extraOptions = cfg.extraOptions;
withBaseWrapper = cfg.wrapperFeatures.base;
withGtkWrapper = cfg.wrapperFeatures.gtk;
enableXWayland = cfg.xwayland.enable;
isNixOS = true;
};
};
wrapperFeatures = {
base =
lib.mkEnableOption ''
the base wrapper to execute extra session commands and prepend a
dbus-run-session to the sway command''
// {
default = true;
};
gtk = lib.mkEnableOption ''
the wrapGAppsHook wrapper to execute sway with required environment
variables for GTK applications'';
};
extraSessionCommands = lib.mkOption {
type = lib.types.lines;
default = "";
example = ''
# SDL:
export SDL_VIDEODRIVER=wayland
# QT (needs qt5.qtwayland in systemPackages):
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
# Fix for some Java AWT applications (e.g. Android Studio),
# use this if they aren't displayed properly:
export _JAVA_AWT_WM_NONREPARENTING=1
'';
description = ''
Shell commands executed just before Sway is started. See
<https://github.com/swaywm/sway/wiki/Running-programs-natively-under-wayland>
and <https://github.com/swaywm/wlroots/blob/master/docs/env_vars.md>
for some useful environment variables.
'';
};
extraOptions = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [
"--verbose"
"--debug"
"--unsupported-gpu"
];
description = ''
Command line arguments passed to launch Sway. Please DO NOT report
issues if you use an unsupported GPU (proprietary drivers).
'';
};
xwayland.enable = lib.mkEnableOption "XWayland" // {
default = true;
};
extraPackages = lib.mkOption {
type = with lib.types; listOf package;
# Packages used in default config
default = with pkgs; [
brightnessctl
foot
grim
pulseaudio
swayidle
swaylock
wmenu
];
defaultText = lib.literalExpression ''
with pkgs; [ brightnessctl foot grim pulseaudio swayidle swaylock wmenu ];
'';
example = lib.literalExpression ''
with pkgs; [ i3status i3status-rust termite rofi light ]
'';
description = ''
Extra packages to be installed system wide. See
<https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway> and
<https://github.com/swaywm/sway/wiki/i3-Migration-Guide#common-x11-apps-used-on-i3-with-wayland-alternatives>
for a list of useful software.
'';
};
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
assertions = [
{
assertion = cfg.extraSessionCommands != "" -> cfg.wrapperFeatures.base;
message = ''
The extraSessionCommands for Sway will not be run if wrapperFeatures.base is disabled.
'';
}
];
warnings =
lib.mkIf
(
(lib.elem "nvidia" config.services.xserver.videoDrivers)
&& (lib.versionOlder (lib.versions.major (lib.getVersion config.hardware.nvidia.package)) "551")
)
[
"Using Sway with Nvidia driver version <= 550 may result in a broken system. Configure hardware.nvidia.package to use a newer version."
];
environment = {
systemPackages = lib.optional (cfg.package != null) cfg.package ++ cfg.extraPackages;
# Needed for the default wallpaper:
pathsToLink = lib.optional (cfg.package != null) "/share/backgrounds/sway";
etc = {
"sway/config.d/nixos.conf".source = pkgs.writeText "nixos.conf" ''
# Import the most important environment variables into the D-Bus and systemd
# user environments (e.g. required for screen sharing and Pinentry prompts):
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
# enable systemd-integration
exec "systemctl --user import-environment {,WAYLAND_}DISPLAY SWAYSOCK; systemctl --user start sway-session.target"
exec swaymsg -t subscribe '["shutdown"]' && systemctl --user stop sway-session.target
'';
}
// lib.optionalAttrs (cfg.package != null) {
"sway/config".source = lib.mkOptionDefault "${cfg.package}/etc/sway/config";
};
};
systemd.user.targets.sway-session = {
description = "sway compositor session";
documentation = [ "man:systemd.special(7)" ];
bindsTo = [ "graphical-session.target" ];
wants = [ "graphical-session-pre.target" ];
after = [ "graphical-session-pre.target" ];
};
# To make a Sway session available if a display manager like SDDM is enabled:
services.displayManager.sessionPackages = lib.optional (cfg.package != null) cfg.package;
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050913
# https://github.com/emersion/xdg-desktop-portal-wlr/blob/master/contrib/wlroots-portals.conf
# https://github.com/emersion/xdg-desktop-portal-wlr/pull/315
xdg.portal.config.sway = {
# Use xdg-desktop-portal-gtk for every portal interface...
default = [ "gtk" ];
# ... except for the ScreenCast, Screenshot and Secret
"org.freedesktop.impl.portal.ScreenCast" = "wlr";
"org.freedesktop.impl.portal.Screenshot" = "wlr";
# ignore inhibit bc gtk portal always returns as success,
# despite sway/the wlr portal not having an implementation,
# stopping firefox from using wayland idle-inhibit
"org.freedesktop.impl.portal.Inhibit" = "none";
};
}
(import ./wayland-session.nix {
inherit lib pkgs;
enableXWayland = cfg.xwayland.enable;
})
]
);
meta.maintainers = [ ];
}

View File

@@ -0,0 +1,130 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.uwsm;
# Helper function to create desktop entry files for UWSM-managed compositors
mk_uwsm_desktop_entry =
opts:
(pkgs.writeTextFile {
name = "${opts.name}-uwsm";
text = ''
[Desktop Entry]
Name=${opts.prettyName} (UWSM)
Comment=${opts.comment}
Exec=${lib.getExe cfg.package} start -F ${opts.binPath}
Type=Application
'';
destination = "/share/wayland-sessions/${opts.name}-uwsm.desktop";
derivationArgs = {
passthru.providedSessions = [ "${opts.name}-uwsm" ];
};
});
in
{
options.programs.uwsm = {
enable = lib.mkEnableOption ''
uwsm, which wraps standalone Wayland compositors with a set
of Systemd units on the fly. This essentially
binds the wayland compositor into `graphical-session-pre.target`,
`graphical-session.target`, `xdg-desktop-autostart.target`.
This is useful for Wayland compositors like Hyprland, Sway, Wayfire,
etc. that do not start these targets and services on their own.
::: {.note}
You must configure `waylandCompositors` suboptions as well
so that UWSM knows which compositors to manage.
Additionally, this by default uses `dbus-broker` as the dbus
implementation for better compatibility. If you dislike this behavior
you can set `services.dbus.implementation = lib.mkForce "dbus"`
in your configuration.
:::
If you are having trouble starting a service that depends on
`graphical-session.target`, while using a WM, enabling this option
might help
'';
package = lib.mkPackageOption pkgs "uwsm" { };
waylandCompositors = lib.mkOption {
description = ''
Configuration for UWSM-managed Wayland Compositors. This
creates a desktop entry file which will be used by Display
Managers like GDM, to allow starting the UWSM managed session.
'';
type = lib.types.attrsOf (
lib.types.submodule (
{ ... }:
{
options = {
prettyName = lib.mkOption {
type = lib.types.str;
description = "The full name of the desktop entry file.";
example = "ExampleWaylandCompositor";
};
comment = lib.mkOption {
type = lib.types.str;
description = "The comment field of the desktop entry file.";
default = "An intelligent Wayland compositor managed by UWSM.";
};
binPath = lib.mkOption {
type = lib.types.path;
description = ''
The wayland-compositor binary path that will be called by UWSM.
It is recommended to use the `/run/current-system/sw/bin/` path
instead of `lib.getExe pkgs.<compositor>` to avoid version mismatch
of the compositor used by UWSM and the one installed in the system.
'';
example = "/run/current-system/sw/bin/ExampleCompositor";
};
};
}
)
);
example = lib.literalExpression ''
hyprland = {
prettyName = "Hyprland";
comment = "Hyprland compositor managed by UWSM";
binPath = "/run/current-system/sw/bin/Hyprland";
};
sway = {
prettyName = "Sway";
comment = "Sway compositor managed by UWSM";
binPath = "/run/current-system/sw/bin/sway";
};
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
systemd.packages = [ cfg.package ];
environment.pathsToLink = [ "/share/uwsm" ];
# UWSM recommends dbus broker for better compatibility
services.dbus.implementation = "broker";
services.displayManager = {
enable = true;
sessionPackages = lib.mapAttrsToList (
name: value:
mk_uwsm_desktop_entry {
inherit name;
inherit (value) prettyName comment binPath;
}
) cfg.waylandCompositors;
};
};
meta.maintainers = with lib.maintainers; [
johnrtitor
kai-tub
];
}

View File

@@ -0,0 +1,37 @@
{
lib,
pkgs,
config,
...
}:
let
cfg = config.programs.waybar;
in
{
options.programs.waybar = {
enable = lib.mkEnableOption "waybar, a highly customizable Wayland bar for Sway and Wlroots based compositors";
package =
lib.mkPackageOption pkgs "waybar" { }
// lib.mkOption {
apply = pkg: pkg.override { systemdSupport = true; };
};
systemd.target = lib.mkOption {
type = lib.types.str;
description = ''
The systemd target that will automatically start the Waybar service.
'';
default = "graphical-session.target";
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
systemd = {
packages = [ cfg.package ];
user.services.waybar.wantedBy = [ cfg.systemd.target ];
};
};
meta.maintainers = [ lib.maintainers.FlorianFranzen ];
}

View File

@@ -0,0 +1,71 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.wayfire;
in
{
meta.maintainers = with lib.maintainers; [ wineee ];
options.programs.wayfire = {
enable = lib.mkEnableOption "Wayfire, a wayland compositor based on wlroots";
package = lib.mkPackageOption pkgs "wayfire" { };
plugins = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = with pkgs.wayfirePlugins; [
wcm
wf-shell
];
defaultText = lib.literalExpression "with pkgs.wayfirePlugins; [ wcm wf-shell ]";
example = lib.literalExpression ''
with pkgs.wayfirePlugins; [
wcm
wf-shell
wayfire-plugins-extra
];
'';
description = ''
Additional plugins to use with the wayfire window manager.
'';
};
xwayland.enable = lib.mkEnableOption "XWayland" // {
default = true;
};
};
config =
let
finalPackage = pkgs.wayfire-with-plugins.override {
wayfire = cfg.package;
plugins = cfg.plugins;
};
in
lib.mkIf cfg.enable (
lib.mkMerge [
{
environment.systemPackages = [ finalPackage ];
services.displayManager.sessionPackages = [ finalPackage ];
xdg.portal = {
enable = lib.mkDefault true;
wlr.enable = lib.mkDefault true;
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050914
config.wayfire.default = lib.mkDefault [
"wlr"
"gtk"
];
};
}
(import ./wayland-session.nix {
inherit lib pkgs;
enableXWayland = cfg.xwayland.enable;
})
]
);
}

View File

@@ -0,0 +1,30 @@
{
lib,
pkgs,
enableXWayland ? true,
enableWlrPortal ? true,
enableGtkPortal ? true,
}:
{
security = {
polkit.enable = true;
pam.services.swaylock = { };
};
programs = {
dconf.enable = lib.mkDefault true;
xwayland.enable = lib.mkIf enableXWayland (lib.mkDefault true);
};
services.graphical-desktop.enable = true;
xdg.portal.wlr.enable = lib.mkIf enableWlrPortal true;
xdg.portal.extraPortals = lib.mkIf enableGtkPortal [
pkgs.xdg-desktop-portal-gtk
];
# Window manager only sessions (unlike DEs) don't handle XDG
# autostart files, so force them to run the service
services.xserver.desktopManager.runXdgAutostartIfNone = lib.mkDefault true;
}