1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-18 23:50:07 +03:00
nixpkgs/nixos/modules/programs/wayland/river.nix

88 lines
2.3 KiB
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
let
2023-05-15 13:45:23 +02:00
cfg = config.programs.river;
wayland-lib = import ./lib.nix { inherit lib; };
in
{
2023-05-15 13:45:23 +02:00
options.programs.river = {
enable = lib.mkEnableOption "river, a dynamic tiling Wayland compositor";
2023-05-15 13:45:23 +02:00
package =
lib.mkPackageOption pkgs "river" {
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;
};
};
2023-05-15 13:45:23 +02:00
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 ''
2023-05-15 13:45:23 +02:00
with pkgs; [ swaylock foot dmenu ];
'';
example = lib.literalExpression ''
2024-05-22 19:14:29 +02:00
with pkgs; [ termite rofi light ]
2023-05-15 13:45:23 +02:00
'';
description = ''
2023-05-15 13:45:23 +02:00
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.
'';
};
};
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;
2023-05-15 13:45:23 +02:00
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050913
xdg.portal.config.river.default = lib.mkDefault [
"wlr"
"gtk"
];
}
2023-11-28 00:49:03 +01:00
(import ./wayland-session.nix {
inherit lib pkgs;
enableXWayland = cfg.xwayland.enable;
})
]
);
2023-05-15 13:45:23 +02:00
meta.maintainers = with lib.maintainers; [ GaetanLepage ];
}