summary refs log tree commit diff
path: root/nixos/modules/programs/miriway.nix
blob: 52b5f84762220fa4d8a80e47e600cb359c4f7c5f (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
60
{ config, pkgs, lib, ... }:

let
  cfg = config.programs.miriway;
in {
  options.programs.miriway = {
    enable = lib.mkEnableOption (lib.mdDoc ''
      Miriway, a Mir based Wayland compositor. You can manually launch Miriway by
      executing "exec miriway" on a TTY, or launch it from a display manager. Copy
      /etc/xdg/xdg-miriway/miriway-shell.config to ~/.config/miriway-shell.config
      to modify the default configuration. See <https://github.com/Miriway/Miriway>,
      and "miriway --help" for more information'');

    config = lib.mkOption {
      type = lib.types.lines;
      default = ''
        x11-window-title=Miriway (Mir-on-X)
        idle-timeout=600
        ctrl-alt=t:miriway-terminal # Default "terminal emulator finder"

        shell-component=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY
      '';
      example = ''
        idle-timeout=300
        ctrl-alt=t:weston-terminal
        add-wayland-extensions=all

        shell-components=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY

        shell-component=waybar
        shell-component=wbg Pictures/wallpaper

        shell-meta=a:synapse
      '';
      description = lib.mdDoc ''
        Miriway's config. This will be installed system-wide.
        The default will install the miriway package's barebones example config.
      '';
    };
  };

  config = lib.mkIf cfg.enable {
    environment = {
      systemPackages = [ pkgs.miriway ];
      etc = {
        "xdg/xdg-miriway/miriway-shell.config".text = cfg.config;
      };
    };

    hardware.opengl.enable = lib.mkDefault true;
    fonts.enableDefaultFonts = lib.mkDefault true;
    programs.dconf.enable = lib.mkDefault true;
    programs.xwayland.enable = lib.mkDefault true;

    # To make the Miriway session available if a display manager like SDDM is enabled:
    services.xserver.displayManager.sessionPackages = [ pkgs.miriway ];
  };

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