Merge pull request #127085 from minijackson/xdg-desktop-portal-wlr-0.4.0-and-module

xdg-desktop-portal-wlr: 0.3.0 -> 0.4.0 and module

authored by

Jan Tojnar and committed by
GitHub
27bbb947 3b392e89

+82 -4
+10
nixos/doc/manual/configuration/wayland.xml
··· 20 20 essential utilities. Now you can start <package>sway</package> from the TTY 21 21 console. 22 22 </para> 23 + 24 + <para> 25 + If you are using a wlroots-based compositor, like sway, and want to be able to 26 + share your screen, you might want to activate this option: 27 + <programlisting> 28 + <xref linkend="opt-xdg.portal.wlr.enable"/> = true; 29 + </programlisting> 30 + and configure Pipewire using <xref linkend="opt-services.pipewire.enable"/> 31 + and related options. 32 + </para> 23 33 </chapter>
+67
nixos/modules/config/xdg/portals/wlr.nix
··· 1 + { config, pkgs, lib, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.xdg.portal.wlr; 7 + package = pkgs.xdg-desktop-portal-wlr; 8 + settingsFormat = pkgs.formats.ini { }; 9 + configFile = settingsFormat.generate "xdg-desktop-portal-wlr.ini" cfg.settings; 10 + in 11 + { 12 + meta = { 13 + maintainers = with maintainers; [ minijackson ]; 14 + }; 15 + 16 + options.xdg.portal.wlr = { 17 + enable = mkEnableOption '' 18 + desktop portal for wlroots-based desktops 19 + 20 + This will add the <package>xdg-desktop-portal-wlr</package> package into 21 + the <option>xdg.portal.extraPortals</option> option, and provide the 22 + configuration file 23 + ''; 24 + 25 + settings = mkOption { 26 + description = '' 27 + Configuration for <package>xdg-desktop-portal-wlr</package>. 28 + 29 + See <literal>xdg-desktop-portal-wlr(5)</literal> for supported 30 + values. 31 + ''; 32 + 33 + type = types.submodule { 34 + freeformType = settingsFormat.type; 35 + }; 36 + 37 + default = { }; 38 + 39 + # Example taken from the manpage 40 + example = literalExample '' 41 + { 42 + screencast = { 43 + output_name = "HDMI-A-1"; 44 + max_fps = 30; 45 + exec_before = "disable_notifications.sh"; 46 + exec_after = "enable_notifications.sh"; 47 + chooser_type = "simple"; 48 + chooser_cmd = "''${pkgs.slurp}/bin/slurp -f %o -or"; 49 + }; 50 + } 51 + ''; 52 + }; 53 + }; 54 + 55 + config = mkIf cfg.enable { 56 + xdg.portal = { 57 + enable = true; 58 + extraPortals = [ package ]; 59 + }; 60 + 61 + systemd.user.services.xdg-desktop-portal-wlr.serviceConfig.ExecStart = [ 62 + # Empty ExecStart value to override the field 63 + "" 64 + "${package}/libexec/xdg-desktop-portal-wlr --config=${configFile}" 65 + ]; 66 + }; 67 + }
+1
nixos/modules/module-list.nix
··· 9 9 ./config/xdg/menus.nix 10 10 ./config/xdg/mime.nix 11 11 ./config/xdg/portal.nix 12 + ./config/xdg/portals/wlr.nix 12 13 ./config/appstream.nix 13 14 ./config/console.nix 14 15 ./config/xdg/sounds.nix
+4 -4
pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix
··· 1 1 { lib, stdenv, fetchFromGitHub, makeWrapper 2 2 , meson, ninja, pkg-config, wayland-protocols 3 - , pipewire, wayland, systemd, libdrm, iniparser, scdoc, grim, slurp }: 3 + , pipewire, wayland, systemd, libdrm, inih, scdoc, grim, slurp }: 4 4 5 5 stdenv.mkDerivation rec { 6 6 pname = "xdg-desktop-portal-wlr"; 7 - version = "0.3.0"; 7 + version = "0.4.0"; 8 8 9 9 src = fetchFromGitHub { 10 10 owner = "emersion"; 11 11 repo = pname; 12 12 rev = "v${version}"; 13 - sha256 = "sha256-6ArUQfWx5rNdpsd8Q22MqlpxLT8GTSsymAf21zGe1KI="; 13 + sha256 = "sha256:13fbzh8bjnhk4xs8j9bpc01q3hy27zpbf0gkk1fnh3hm5pnyfyiv"; 14 14 }; 15 15 16 16 nativeBuildInputs = [ meson ninja pkg-config wayland-protocols makeWrapper ]; 17 - buildInputs = [ pipewire wayland systemd libdrm iniparser scdoc ]; 17 + buildInputs = [ pipewire wayland systemd libdrm inih scdoc ]; 18 18 19 19 mesonFlags = [ 20 20 "-Dsd-bus-provider=libsystemd"