nixpkgs/nixos/modules
Bryan Gardiner 2400191caf
nixos/xdg/mime: disable fdatasync when building the XDG MIME database
Back in 2013, update-mime-database started using fdatasync() to write out
its changes after processing each file in /share/mime, with the reasoning
that a corrupted database from an interruption midway would be
problematic for applications[1].  Unfortunately, this caused a
significant regression in the time required to run update-mime-database:
commonly from under a second to half a minute or more.

This delay affects the time required to build system-path on NixOS, when
xdg.mime.enable is true (the default).  For example, on one of my systems
system-path builds in ~48 seconds, 45 of which are update-mime-database.
This makes rapidly building new system configurations not fun.

This commit disables the calls to fdatasync().  update-mime-database
checks an environment variable, PKGSYSTEM_ENABLE_FSYNC, to determine
whether it should sync, and we can set this to false.  system-path
already only has whatever filesystem commit guarantees that the Nix
builder provides.  Furthermore, there is no risk of a failed MIME
database update messing up existing packages, because this is Nix.

(This issue was also reported at and discussed by Debian, Red Hat, and
Gentoo at least.)

[1] https://bugs.freedesktop.org/show_bug.cgi?id=70366
2019-05-25 21:00:25 -07:00
..
config nixos/xdg/mime: disable fdatasync when building the XDG MIME database 2019-05-25 21:00:25 -07:00
hardware nixos/all-firmware: Enable facetimehd only for i686/x86_64 2019-05-06 10:49:42 +02:00
i18n/input-method docs: format 2018-09-29 20:51:11 -04:00
installer Merge pull request #60207 from volth/patch-329 2019-05-22 15:32:00 +03:00
misc nixos/factorio: sandbox service using systemd 2019-05-17 10:25:49 +02:00
profiles nixos/hardened: use graphene-hardened malloc by default 2019-05-07 13:45:39 +02:00
programs Merge pull request #60406 from JohnAZoidberg/remove-isnull 2019-05-18 09:36:24 +00:00
security FIx some malformed XML in option descriptions 2019-05-13 09:15:17 +02:00
services Merge pull request #56175 from MostAwesomeDude/tahoe-service 2019-05-25 21:53:23 +02:00
system Merge pull request #61036 from cdepillabout/nixos-memtest-loader 2019-05-20 21:42:40 -05:00
tasks cleanup redundant text in modules utilizing mkEnableOption 2019-04-20 14:44:02 +02:00
testing types.optionSet: deprecate and remove last usages 2019-01-31 00:41:10 +02:00
virtualisation docker: fix typo 2019-05-22 08:40:01 -07:00
module-list.nix nixos/bitcoind: add bitcoind service 2019-05-22 15:48:57 -04:00
rename.nix winstone: drop package and service 2019-05-15 20:30:48 +02:00