nixos/malloc: apply allocator settings to systemd units

This uses systemd's system.conf/user.conf "DefaultEnvironment" feature
to set the allocator's LD_PRELOAD near-globally.
This commit is contained in:
Pierre Bourdon 2019-05-30 12:07:34 +09:00
parent 4b428d8c09
commit 9e60eab8f5
No known key found for this signature in database
GPG key ID: 6FB80DCD84DA0F1C

View file

@ -91,5 +91,7 @@ in
config = mkIf (cfg.provider != "libc") {
environment.variables.LD_PRELOAD = providerLibPath;
systemd.extraConfig = "DefaultEnvironment=\"LD_PRELOAD=${providerLibPath}\"";
systemd.user.extraConfig = "DefaultEnvironment=\"LD_PRELOAD=${providerLibPath}\"";
};
}