about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-11-12 20:32:05 +0000
committerGitHub <noreply@github.com>2019-11-12 20:32:05 +0000
commitb252047216f89d6b3074ce8e6a40dbb75286b327 (patch)
treeeae375c4fd3f668b7924993541f592f59f5f3b4c /nixos/modules
parentfed00b18735991c9f2e4538ce5144de7fe1342e9 (diff)
parent927a6fdaad493044f2344cba73e6310d3450ca00 (diff)
downloadnixlib-b252047216f89d6b3074ce8e6a40dbb75286b327.tar
nixlib-b252047216f89d6b3074ce8e6a40dbb75286b327.tar.gz
nixlib-b252047216f89d6b3074ce8e6a40dbb75286b327.tar.bz2
nixlib-b252047216f89d6b3074ce8e6a40dbb75286b327.tar.lz
nixlib-b252047216f89d6b3074ce8e6a40dbb75286b327.tar.xz
nixlib-b252047216f89d6b3074ce8e6a40dbb75286b327.tar.zst
nixlib-b252047216f89d6b3074ce8e6a40dbb75286b327.zip
Merge pull request #71390 from hedning/enable-gnome-shell-RT
Enable soft real time for gnome shell 
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/x11/desktop-managers/gnome3.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix
index 88350a176506..0135ac19cbf7 100644
--- a/nixos/modules/services/x11/desktop-managers/gnome3.nix
+++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix
@@ -278,6 +278,26 @@ in
         source-sans-pro
       ];
 
+      ## Enable soft realtime scheduling, only supported on wayland ##
+
+      security.wrappers.".gnome-shell-wrapped" = {
+        source = "${pkgs.gnome3.gnome-shell}/bin/.gnome-shell-wrapped";
+        capabilities = "cap_sys_nice=ep";
+      };
+
+      systemd.user.services.gnome-shell-wayland = let
+        gnomeShellRT = with pkgs.gnome3; pkgs.runCommand "gnome-shell-rt" {} ''
+          mkdir -p $out/bin/
+          cp ${gnome-shell}/bin/gnome-shell $out/bin
+          sed -i "s@${gnome-shell}/bin/@${config.security.wrapperDir}/@" $out/bin/gnome-shell
+        '';
+      in {
+        # Note we need to clear ExecStart before overriding it
+        serviceConfig.ExecStart = ["" "${gnomeShellRT}/bin/gnome-shell"];
+        # Do not use the default environment, it provides a broken PATH
+        environment = mkForce {};
+      };
+
       # Adapt from https://gitlab.gnome.org/GNOME/gnome-build-meta/blob/gnome-3-32/elements/core/meta-gnome-core-shell.bst
       environment.systemPackages = with pkgs.gnome3; [
         adwaita-icon-theme