Pre‐allocate hugepages for Firefox, Thunderbird and mpv

This commit is contained in:
Mikael 2024-10-11 11:23:05 +02:00
parent 4df412b109
commit 014cd8eb9c
Signed by: mikael
SSH key fingerprint: SHA256:21QyD2Meiot7jOUVitIR5YkGB/XuXdCvLW1hE6dsri0

View file

@ -15,9 +15,26 @@ in {
secureBuild = true; secureBuild = true;
}; };
firefox = final.wrapFirefox final.firefox-unwrapped { }; firefox = (final.wrapFirefox final.firefox-unwrapped { }).overrideAttrs (prevAttrs: {
mpv = final.mpv-unwrapped.wrapper { mpv = final.mpv-unwrapped; }; buildCommand = prevAttrs.buildCommand + ''
thunderbird = final.wrapThunderbird final.thunderbird-unwrapped { }; sed -i \
'$i export MIMALLOC_RESERVE_HUGE_OS_PAGES=2' \
"$out/bin/firefox"
'';
});
thunderbird = (final.wrapThunderbird final.thunderbird-unwrapped { }).overrideAttrs (prevAttrs: {
buildCommand = prevAttrs.buildCommand + ''
sed -i \
'$i export MIMALLOC_RESERVE_HUGE_OS_PAGES=2' \
"$out/bin/thunderbird"
'';
});
mpv = final.mpv-unwrapped.wrapper {
mpv = final.mpv-unwrapped;
extraMakeWrapperArgs = [ "--set" "MIMALLOC_RESERVE_HUGE_OS_PAGES" "1" ];
};
} // lib.genAttrs [ } // lib.genAttrs [
"bat" "bat"
"bottom" "bottom"