about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRobert Schütz <dev@schuetz-co.de>2021-06-25 10:02:10 +0200
committerRobert Schütz <dev@schuetz-co.de>2021-06-25 10:02:10 +0200
commitc1dca92daf8de1a7421d412f2fa68fab16a0289a (patch)
treeab8668d289e2b8393c0540720618cfb3e50eca95 /nixos
parentd437a6cac2086ead6232bc4d84c25c58a33c1b59 (diff)
parent5555f34784ef4013e207097f9da8f2861eb5b9e3 (diff)
Merge branch 'master' into staging-next
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/configuration/wayland.xml10
-rw-r--r--nixos/doc/manual/configuration/x-windows.xml4
-rw-r--r--nixos/doc/manual/from_md/release-notes/rl-2111.section.xml8
-rw-r--r--nixos/doc/manual/release-notes/rl-2111.section.md2
-rw-r--r--nixos/modules/config/xdg/portals/wlr.nix67
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/tests/sway.nix9
7 files changed, 97 insertions, 4 deletions
diff --git a/nixos/doc/manual/configuration/wayland.xml b/nixos/doc/manual/configuration/wayland.xml
index 231c219cf0811..2aefda3e22c01 100644
--- a/nixos/doc/manual/configuration/wayland.xml
+++ b/nixos/doc/manual/configuration/wayland.xml
@@ -20,4 +20,14 @@
   essential utilities. Now you can start <package>sway</package> from the TTY
   console.
  </para>
+
+ <para>
+  If you are using a wlroots-based compositor, like sway, and want to be able to
+  share your screen, you might want to activate this option:
+<programlisting>
+<xref linkend="opt-xdg.portal.wlr.enable"/> = true;
+</programlisting>
+  and configure Pipewire using <xref linkend="opt-services.pipewire.enable"/>
+  and related options.
+ </para>
 </chapter>
diff --git a/nixos/doc/manual/configuration/x-windows.xml b/nixos/doc/manual/configuration/x-windows.xml
index 315ed3acf9719..f9121508d7d40 100644
--- a/nixos/doc/manual/configuration/x-windows.xml
+++ b/nixos/doc/manual/configuration/x-windows.xml
@@ -241,11 +241,11 @@ xkb_symbols &quot;us-greek&quot;
   description = "US layout with alt-gr greek";
   languages   = [ "eng" ];
   symbolsFile = /yourpath/symbols/us-greek;
-}
+};
 </programlisting>
   <note>
   <para>
-   The name should match the one given to the
+   The name (after <literal>extraLayouts.</literal>) should match the one given to the
    <literal>xkb_symbols</literal> block.
   </para>
   </note>
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
index bb00cde019564..50403cc319b5f 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
@@ -81,6 +81,14 @@
       </listitem>
       <listitem>
         <para>
+          <literal>consul</literal> was upgraded to a new major release
+          with breaking changes, see
+          <link xlink:href="https://github.com/hashicorp/consul/releases/tag/v1.10.0">upstream
+          changelog</link>.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
           fsharp41 has been removed in preference to use the latest
           dotnet-sdk
         </para>
diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md
index e8a751517361c..bff791bc85d96 100644
--- a/nixos/doc/manual/release-notes/rl-2111.section.md
+++ b/nixos/doc/manual/release-notes/rl-2111.section.md
@@ -26,6 +26,8 @@ In addition to numerous new and upgraded packages, this release has the followin
 
 - Those making use of `buildBazelPackage` will need to regenerate the fetch hashes (preferred), or set `fetchConfigured = false;`.
 
+- `consul` was upgraded to a new major release with breaking changes, see [upstream changelog](https://github.com/hashicorp/consul/releases/tag/v1.10.0).
+
 - fsharp41 has been removed in preference to use the latest dotnet-sdk
 
 - The following F#-related packages have been removed for being unmaintaned. Please use `fetchNuGet` for specific packages.
diff --git a/nixos/modules/config/xdg/portals/wlr.nix b/nixos/modules/config/xdg/portals/wlr.nix
new file mode 100644
index 0000000000000..55baab0026b26
--- /dev/null
+++ b/nixos/modules/config/xdg/portals/wlr.nix
@@ -0,0 +1,67 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let
+  cfg = config.xdg.portal.wlr;
+  package = pkgs.xdg-desktop-portal-wlr;
+  settingsFormat = pkgs.formats.ini { };
+  configFile = settingsFormat.generate "xdg-desktop-portal-wlr.ini" cfg.settings;
+in
+{
+  meta = {
+    maintainers = with maintainers; [ minijackson ];
+  };
+
+  options.xdg.portal.wlr = {
+    enable = mkEnableOption ''
+      desktop portal for wlroots-based desktops
+
+      This will add the <package>xdg-desktop-portal-wlr</package> package into
+      the <option>xdg.portal.extraPortals</option> option, and provide the
+      configuration file
+    '';
+
+    settings = mkOption {
+      description = ''
+        Configuration for <package>xdg-desktop-portal-wlr</package>.
+
+        See <literal>xdg-desktop-portal-wlr(5)</literal> for supported
+        values.
+      '';
+
+      type = types.submodule {
+        freeformType = settingsFormat.type;
+      };
+
+      default = { };
+
+      # Example taken from the manpage
+      example = literalExample ''
+        {
+          screencast = {
+            output_name = "HDMI-A-1";
+            max_fps = 30;
+            exec_before = "disable_notifications.sh";
+            exec_after = "enable_notifications.sh";
+            chooser_type = "simple";
+            chooser_cmd = "''${pkgs.slurp}/bin/slurp -f %o -or";
+          };
+        }
+      '';
+    };
+  };
+
+  config = mkIf cfg.enable {
+    xdg.portal = {
+      enable = true;
+      extraPortals = [ package ];
+    };
+
+    systemd.user.services.xdg-desktop-portal-wlr.serviceConfig.ExecStart = [
+      # Empty ExecStart value to override the field
+      ""
+      "${package}/libexec/xdg-desktop-portal-wlr --config=${configFile}"
+    ];
+  };
+}
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 625bbeb3bcd1e..84620ba3eb235 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -9,6 +9,7 @@
   ./config/xdg/menus.nix
   ./config/xdg/mime.nix
   ./config/xdg/portal.nix
+  ./config/xdg/portals/wlr.nix
   ./config/appstream.nix
   ./config/console.nix
   ./config/xdg/sounds.nix
diff --git a/nixos/tests/sway.nix b/nixos/tests/sway.nix
index 0985e0b4308b2..21900ee4c0145 100644
--- a/nixos/tests/sway.nix
+++ b/nixos/tests/sway.nix
@@ -15,7 +15,10 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
       # For glinfo and wayland-info:
       systemPackages = with pkgs; [ mesa-demos wayland-utils ];
       # Use a fixed SWAYSOCK path (for swaymsg):
-      variables."SWAYSOCK" = "/tmp/sway-ipc.sock";
+      variables = {
+        "SWAYSOCK" = "/tmp/sway-ipc.sock";
+        "WLR_RENDERER_ALLOW_SOFTWARE" = "1";
+      };
       # For convenience:
       shellAliases = {
         test-x11 = "glinfo | head -n 3 | tee /tmp/test-x11.out && touch /tmp/test-x11-exit-ok";
@@ -101,6 +104,8 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
 
     # Exit Sway and verify process exit status 0:
     machine.succeed("su - alice -c 'swaymsg exit || true'")
-    machine.wait_for_file("/tmp/sway-exit-ok")
+    # TODO: Sway currently segfaults after "swaymsg exit" but only in this VM test:
+    # machine # [  104.090032] sway[921]: segfault at 3f800008 ip 00007f7dbdc25f10 sp 00007ffe282182f8 error 4 in libwayland-server.so.0.1.0[7f7dbdc1f000+8000]
+    # machine.wait_for_file("/tmp/sway-exit-ok")
   '';
 })