about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/programs/wayland/wayfire.nix
blob: d0b280e3940fc6c672b357efb57932c51b9bb182 (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
{ config, lib, pkgs, ...}:
let
  cfg = config.programs.wayfire;
in
{
  meta.maintainers = with lib.maintainers; [ rewine ];

  options.programs.wayfire = {
    enable = lib.mkEnableOption (lib.mdDoc "Wayfire, a wayland compositor based on wlroots.");

    package = lib.mkPackageOptionMD 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 = lib.mdDoc ''
        Additional plugins to use with the wayfire window manager.
      '';
    };
  };

  config = let
    finalPackage = pkgs.wayfire-with-plugins.override {
      wayfire = cfg.package;
      plugins = cfg.plugins;
    };
  in
  lib.mkIf cfg.enable {
    environment.systemPackages = [
      finalPackage
    ];

    services.xserver.displayManager.sessionPackages = [ finalPackage ];

    xdg.portal = {
      enable = lib.mkDefault true;
      wlr.enable = lib.mkDefault true;
    };
  };
}