summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@secure.mailbox.org>2018-07-14 13:16:18 -0500
committerGitHub <noreply@github.com>2018-07-14 13:16:18 -0500
commit5ea799defc88f18f138517094a4d031acc00e383 (patch)
tree55c7c51abbdcb9c3911eceb532ea3a1706c49572 /nixos
parent1301973797ac540a20d782859bedd23f6719c7e2 (diff)
parentcd4e54b3a11451fd5e03297790b3d3a00a08e188 (diff)
downloadnixlib-5ea799defc88f18f138517094a4d031acc00e383.tar
nixlib-5ea799defc88f18f138517094a4d031acc00e383.tar.gz
nixlib-5ea799defc88f18f138517094a4d031acc00e383.tar.bz2
nixlib-5ea799defc88f18f138517094a4d031acc00e383.tar.lz
nixlib-5ea799defc88f18f138517094a4d031acc00e383.tar.xz
nixlib-5ea799defc88f18f138517094a4d031acc00e383.tar.zst
nixlib-5ea799defc88f18f138517094a4d031acc00e383.zip
Merge pull request #43243 from peterhoeg/f/sddmqt
sddm: use tmpfiles.d to wipe QML cache
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/x11/display-managers/sddm.nix26
1 files changed, 15 insertions, 11 deletions
diff --git a/nixos/modules/services/x11/display-managers/sddm.nix b/nixos/modules/services/x11/display-managers/sddm.nix
index 8db7414e811f..426b899586f5 100644
--- a/nixos/modules/services/x11/display-managers/sddm.nix
+++ b/nixos/modules/services/x11/display-managers/sddm.nix
@@ -19,17 +19,6 @@ let
 
   Xsetup = pkgs.writeScript "Xsetup" ''
     #!/bin/sh
-
-    # Prior to Qt 5.9.2, there is a QML cache invalidation bug which sometimes
-    # strikes new Plasma 5 releases. If the QML cache is not invalidated, SDDM
-    # will segfault without explanation. We really tore our hair out for awhile
-    # before finding the bug:
-    # https://bugreports.qt.io/browse/QTBUG-62302
-    # We work around the problem by deleting the QML cache before startup. It
-    # will be regenerated, causing a small but perceptible delay when SDDM
-    # starts.
-    rm -fr /var/lib/sddm/.cache/sddm-greeter/qmlcache
-
     ${cfg.setupScript}
   '';
 
@@ -285,5 +274,20 @@ in
     # To enable user switching, allow sddm to allocate TTYs/displays dynamically.
     services.xserver.tty = null;
     services.xserver.display = null;
+
+    systemd.tmpfiles.rules = [
+      # Prior to Qt 5.9.2, there is a QML cache invalidation bug which sometimes
+      # strikes new Plasma 5 releases. If the QML cache is not invalidated, SDDM
+      # will segfault without explanation. We really tore our hair out for awhile
+      # before finding the bug:
+      # https://bugreports.qt.io/browse/QTBUG-62302
+      # We work around the problem by deleting the QML cache before startup.
+      # This was supposedly fixed in Qt 5.9.2 however it has been reported with
+      # 5.10 and 5.11 as well. The initial workaround was to delete the directory
+      # in the Xsetup script but that doesn't do anything.
+      # Instead we use tmpfiles.d to ensure it gets wiped.
+      # This causes a small but perceptible delay when SDDM starts.
+      "e ${config.users.users.sddm.home}/.cache - - - 0"
+    ];
   };
 }