Skip to content

Commit

Permalink
nixos/malloc: use ld preload
Browse files Browse the repository at this point in the history
This is more robust than setting via environment variable, though it does come
later in the load sequence.  An added benefit is affecting the current
session.
  • Loading branch information
joachifm committed Jul 4, 2019
1 parent 6a6d115 commit 44b6999
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions nixos/modules/config/malloc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,13 @@ in
and/or service failure.
</para>
</warning>
<note>
<para>
Changing this option does not affect the current session.
</para>
</note>
'';
};
};

config = mkIf (cfg.provider != "libc") {
environment.variables.LD_PRELOAD = providerLibPath;
systemd.extraConfig = "DefaultEnvironment=\"LD_PRELOAD=${providerLibPath}\"";
systemd.user.extraConfig = "DefaultEnvironment=\"LD_PRELOAD=${providerLibPath}\"";
environment.etc."ld-nix.so.preload".text = ''
${providerLibPath}
'';
};
}

0 comments on commit 44b6999

Please sign in to comment.