1{ config, lib, pkgs, ...}:
2let
3 cfg = config.programs.wayfire;
4in
5{
6 meta.maintainers = with lib.maintainers; [ rewine ];
7
8 options.programs.wayfire = {
9 enable = lib.mkEnableOption "Wayfire, a wayland compositor based on wlroots";
10
11 package = lib.mkPackageOption pkgs "wayfire" { };
12
13 plugins = lib.mkOption {
14 type = lib.types.listOf lib.types.package;
15 default = with pkgs.wayfirePlugins; [ wcm wf-shell ];
16 defaultText = lib.literalExpression "with pkgs.wayfirePlugins; [ wcm wf-shell ]";
17 example = lib.literalExpression ''
18 with pkgs.wayfirePlugins; [
19 wcm
20 wf-shell
21 wayfire-plugins-extra
22 ];
23 '';
24 description = ''
25 Additional plugins to use with the wayfire window manager.
26 '';
27 };
28 };
29
30 config = let
31 finalPackage = pkgs.wayfire-with-plugins.override {
32 wayfire = cfg.package;
33 plugins = cfg.plugins;
34 };
35 in
36 lib.mkIf cfg.enable {
37 environment.systemPackages = [
38 finalPackage
39 ];
40
41 services.displayManager.sessionPackages = [ finalPackage ];
42
43 xdg.portal = {
44 enable = lib.mkDefault true;
45 wlr.enable = lib.mkDefault true;
46 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050914
47 config.wayfire.default = lib.mkDefault [ "wlr" "gtk" ];
48 };
49 };
50}