fractal: Pre‐allocate single hugepage

This commit is contained in:
Mikael 2024-10-11 12:31:09 +02:00
parent 4d9d033d4c
commit 00fab0858d
Signed by: mikael
SSH key fingerprint: SHA256:21QyD2Meiot7jOUVitIR5YkGB/XuXdCvLW1hE6dsri0

View file

@ -31,6 +31,18 @@ in {
''; '';
}); });
fractal = prev.fractal.overrideAttrs (prevAttrs: {
nativeBuildInputs = prevAttrs.nativeBuildInputs or [ ] ++ [ final.makeBinaryWrapper ];
buildInputs = prevAttrs.buildInputs or [ ] ++ [ final.mimalloc ];
NIX_RUSTFLAGS = lib.toList prevAttrs.NIX_RUSTFLAGS or [ ] ++ [ "-C link-arg=-lmimalloc" ];
postInstall = prevAttrs.postInstall or "" + ''
wrapProgram "$out/bin/fractal" \
--set MIMALLOC_RESERVE_HUGE_OS_PAGES 1
'';
});
mpv = final.mpv-unwrapped.wrapper { mpv = final.mpv-unwrapped.wrapper {
mpv = final.mpv-unwrapped; mpv = final.mpv-unwrapped;
extraMakeWrapperArgs = [ "--set" "MIMALLOC_RESERVE_HUGE_OS_PAGES" "1" ]; extraMakeWrapperArgs = [ "--set" "MIMALLOC_RESERVE_HUGE_OS_PAGES" "1" ];
@ -43,7 +55,6 @@ in {
"erlang" "erlang"
"fd" "fd"
"firefox-unwrapped" "firefox-unwrapped"
"fractal"
"fuzzel" "fuzzel"
"helix" "helix"
"kitty" "kitty"