git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit9e60eab8f546a81feefe32d2ebf03420131f04e6 authorPierre Bourdon <delroth@gmail.com> dateThu 30 May 2019, 12:07 (7 years ago) parent4b428d8
1 file changed+2
nixos/modules/config/malloc.nix+2
nixos/modules/config/malloc.nix+2
@@ -91,5 +91,7 @@ in
9191
9292 config = mkIf (cfg.provider != "libc") {
9393 environment.variables.LD_PRELOAD = providerLibPath;
94+ systemd.extraConfig = "DefaultEnvironment=\"LD_PRELOAD=${providerLibPath}\"";
95+ systemd.user.extraConfig = "DefaultEnvironment=\"LD_PRELOAD=${providerLibPath}\"";
9496 };
9597}