Change:
# Try mounting fonts and icons from NixOS locations if FHS locations don't exist. # https://github.com/NixOS/nixpkgs/issues/119433 ./fix-fonts-icons.patch <ins> # TODO: Remove when updating to 1.16 # Ensure flatpak uses the system's zoneinfo from $TZDIR # https://github.com/NixOS/nixpkgs/issues/238386 (fetchpatch { url = "https://github.com/flatpak/flatpak/pull/5850/commits/a8a35bf4d9fc3d76e1a5049a6a591faec04a42fd.patch"; hash = "sha256-JqkPbnzgZNZq/mplZqohhHFdjRrvYFjE4C02pI3feBo="; }) (fetchpatch { url = "https://github.com/flatpak/flatpak/pull/5850/commits/5ea13b09612215559081c27b60df4fb720cb08d5.patch"; hash = "sha256-BWbyQ2en3RtN4Ec5n62CULAhvywlQLhcl3Fmd4fsR1s="; }) (fetchpatch { url = "https://github.com/flatpak/flatpak/pull/5850/commits/7c8a81f08908019bbf69358de199748a9bcb29e3.patch"; hash = "sha256-RiG2jPmG+Igskxv8oQquOUYsG4srgdMXWe34ojMXslo="; }) </ins> ]; nativeBuildInputs = [

Discussion:
The time in kodi home page is always shown in UTC. Kodi seem to use TZ env variable to configure the desired timezone () I tried in a bash shell inside container date =Sun Jun 18 11:31:13 CEST 2023 OK =CEST is 2h more than UTC =Sun Jun 18 09:31:42 CET 2023 KO =should be Sun Jun 18 11:31:42 CEST 2023 =Sun Jun 18 09:31:45 CEST 2023 KO =should be Sun Jun 18 11:31:45 CEST 2023 I tried those commands in another flatpak container (firefox), and the result is the same. I tried it in kodi flatpak with another OS (ubuntu 22.04), and all the commands are working correctly (date in desired timezone) I tried it directly on nixos, and the date is correctly shown with TZ=CET, but not with TZ=CEST. I tried it directly on ubuntu 22.04, and all the commands are working correctly My nixos channel is
Found something, If I set the env variable TZDIR=/usr/share/zoneinfo, this is working for TZ=CET in flatpak
Anyone?
Perhaps I forgot that:
This is troubling me too. When I enter bash using I see that TZDIR is set to /etc/zoneinfo and this directory does not exist within this shell session (within the sandbox)
In can confirm that starting Kodi like presents the right time.
/usr/share/zoneinfo is the directory where the Flatpak environment org.freedesktop.Platform provides the timezone files. and if I start Kodi with flatpak run --unset-env=TZDIR it also displays the right time. So I think the issue is that the TZDIR env variable is inherited from Nix environment
Related as reported by Guix dev I think it would work if nixpkgs adds TZDIR to the env variables to unset in
I entered this command once : flatpak override --env=TZDIR=/usr/share/zoneinfo And it is working every time. No need to do something with the run command But I agree that it should be done elsewhere (unset-env-vars seem to be great)
any input on the above?

Looks like this was recently fixed in Flatpak
In 1.15.9
Sorry for the wait, I could've sworn I responded to this I've opened with the mentioned patch. Thanks for the report!
Thanks for looking into this! When running Kodi using the patched nixpkgs Flatpak, I don't get the expected effect. I am not sure why. I see that the original Flatpak fix attempts to use TZDIR to do some ro-bind with bubblewrap but I don't see that argument when I look at the output of ps so perhaps the issue is in the original Flatpak fix. I find this part of the Flatpak fix strange "--ro-bind", tzdir, "/usr/share/zoneinfo", If I understand it right, it attempts to mount the TZDIR directory below /usr/share/zoneinfo But with TZDIR set, applications will try to look under TZDIR under the value of TZDIR not under /usr/share/zoneinfo So unless I misunderstand something I think the original Flatpak fix may not work as intended (which would not be a nixpkgs problem but affect nixpkgs)
My understanding is it's linking the path of (instead of on host) to inside bubblewrap, not passing environment variable into it (I don't see the relevant code. However this may have been implemented elsewhere)
Yes I think it does this too. But I think it does not address the problem that occurs on NixOS. If I start Kodi using the patched Flatpak like this ./result/bin/flatpak run and then We can see that TZDIR, as passed into the Flatpak sandbox by NixOS is not present in the sandbox When asking date for current time in my current timezone first without timzone and then with my timezone, I can see it differs. But when passing a path inside the sandbox that exists there, it works I think this happens because date comment attempts to access timezone files in TZDIR=/etc/zoneinfo which is not mounted into the sandbox. I would have assumed the original Flatpak patch attempted to do that, but it does something else. So I think the original patch is not addressing the issue that occurs in NixOS.

I don't know what it does actually
I think there are two possible paths forward for NixOS: Either don't pass TZDIR into the sandbox and let the default be used instead, or by mounting the contents of NixOS TZDIR into TZDIR inside the sandbox. The first option would use Flatpak's own timezone files for timezone lookup. The second would use what NixOS uses. Ideally Flatpak would have solved it the second way in their fix but it seems it does not really do that
Try: available inside flatpak? setting , is that also available inside flatpak?
No it is not it is
Good, now we'll have another patch dedicated to Nixpkgs.
I think that is right. Flatpak should add to blacklist (i.e. ) upstream, now that from the host is properly mounted to in the guest.
is approved and awaiting merge. would you mind having a look?