about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/programs/wayland/river.nix
blob: 71232a7d2618ce12e42ca4ad94e6915b3e17c73e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
  config,
  pkgs,
  lib,
  ...
}:
with lib; let
  cfg = config.programs.river;
in {
  options.programs.river = {
    enable = mkEnableOption (lib.mdDoc "river, a dynamic tiling Wayland compositor");

    package = mkOption {
      type = with types; nullOr package;
      default = pkgs.river;
      defaultText = literalExpression "pkgs.river";
      description = lib.mdDoc ''
        River package to use.
        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.
      '';
    };

    extraPackages = mkOption {
      type = with types; listOf package;
      default = with pkgs; [
        swaylock
        foot
        dmenu
      ];
      defaultText = literalExpression ''
        with pkgs; [ swaylock foot dmenu ];
      '';
      example = literalExpression ''
        with pkgs; [
          termite rofi light
        ]
      '';
      description = lib.mdDoc ''
        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 =
    mkIf cfg.enable (mkMerge [
      {
        environment.systemPackages = optional (cfg.package != null) cfg.package ++ cfg.extraPackages;

        # To make a river session available if a display manager like SDDM is enabled:
        services.xserver.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ];
      }
      (import ./wayland-session.nix { inherit lib pkgs; })
    ]);

  meta.maintainers = with lib.maintainers; [ GaetanLepage ];
}