[Optimizations] Add customizable optimizePkg function to configuration

It allows us to share the optimizePkg helper from the optimization to other areas.
This commit is contained in:
Antoine Viallon 2023-05-02 20:38:07 +02:00
parent 903c5ecf86
commit 3145509fcc
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -41,6 +41,12 @@ in {
description = "Add specific compile flags";
type = types.listOf types.str;
};
optimizePkg = mkOption {
default = optimizePkg;
example = "pkg: pkg.override { stdenv = pkgs.fastStdenv; }";
description = "Function used for optimizing packages";
type = with types; functionTo (functionTo package);
};
trace = mkEnableOption "trace attributes in overriden derivations";
blacklist = mkOption {
default = [ # Broken
@ -113,7 +119,6 @@ in {
level = "slower";
recursive = 1;
lto = true;
extraCFlags = cfg.extraCompileFlags;
} super.mesa;
optipngOptimized = optimizePkg {
level = "unsafe";