NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.74k stars 13.17k forks source link

TZDIR is not set when starting processes in KDE Plasma #248358

Open Keksgesicht opened 11 months ago

Keksgesicht commented 11 months ago

Describe the bug

Process started by kwin_wayland (not plasmashell) have not set TZDIR. When using the kickoff menu or the command line Kalendar shows normal behavior. image

First started by overview effect or shortcut. Second started kickoff menu or konsole.

[user@system:~]$ cat /proc/$(pidof kalendar)/environ | tr '\0' '\n' | grep TZ
[user@system:~]$ cat /proc/$(pidof kalendar)/environ | tr '\0' '\n' | grep TZ
TZDIR=/etc/zoneinfo

Steps To Reproduce

Steps to reproduce the behavior:

  1. define a khotkey (Shortcut) for kalendar
  2. use this hotkey or start kalendar through KRunner in overview effect
  3. Kalendar thinks it is 24 hours in the future, but renders line at 22 hours in the future.

Expected behavior

Kalendar shows my events and correct day

Screenshots

image

Additional context

The digital clock widget has another problem, but here some of my findings with similar problems https://github.com/NixOS/nixpkgs/issues/143272 https://bugs.kde.org/show_bug.cgi?id=400451

My current workaround is to run ln -s /etc/zoneinfo usr/share/zoneinfo manually during my install process. https://invent.kde.org/plasma/plasma-workspace/-/blob/4df78f841cc16a61d862b5b183e773e9f66436b8/ktimezoned/ktimezoned.cpp#L124 https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/plasma-5/plasma-desktop/tzdir.patch

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 6.1.42, NixOS, 23.05 (Stoat), 23.05.2478.bd836ac5e5a7`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.13.3`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Keksgesicht commented 9 months ago

Ok you could also do my current workaround with a declaritive NixOS config:

  systemd.tmpfiles.rules = [
    "L+    /usr/share/zoneinfo   -    -    -     -    ${pkgs.tzdata}/share/zoneinfo"
  ];

But this does not really fix the actual problem.