move optimizeWithFlags

This commit is contained in:
2025-04-07 14:31:56 -04:00
parent aa5c015099
commit b764d2de45
2 changed files with 17 additions and 16 deletions

View File

@@ -144,6 +144,22 @@
inputs
serviceMountDeps
;
# stolen from: https://stackoverflow.com/a/42398526
optimizeWithFlags =
pkg: flags:
nixpkgs.lib.overrideDerivation pkg (
old:
let
newflags = nixpkgs.lib.foldl' (acc: x: "${acc} ${x}") "" flags;
oldflags =
if (nixpkgs.lib.hasAttr "NIX_CFLAGS_COMPILE" old) then "${old.NIX_CFLAGS_COMPILE}" else "";
in
{
NIX_CFLAGS_COMPILE = "${oldflags} ${newflags}";
# stdenv = pkgs.clang19Stdenv;
}
);
};
modules =
[