mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 09:47:52 +00:00
[Overlays/Optimizations] Make optimizations disable-able
This commit is contained in:
parent
5b5bb79228
commit
f0ac8c8151
1 changed files with 8 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ let
|
||||||
NIX_CFLAGS_COMPILE = toString ([ (attrs.NIX_CFLAGS_COMPILE or "") ] ++ flags);
|
NIX_CFLAGS_COMPILE = toString ([ (attrs.NIX_CFLAGS_COMPILE or "") ] ++ flags);
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
});
|
});
|
||||||
optimizeForThisHost = pkg:
|
_optimizeForThisHost = pkg:
|
||||||
pkg.overrideAttrs (attrs: let
|
pkg.overrideAttrs (attrs: let
|
||||||
cflags = [ (attrs.NIX_CFLAGS_COMPILE or "") ] ++ config.aviallon.programs.compileFlags;
|
cflags = [ (attrs.NIX_CFLAGS_COMPILE or "") ] ++ config.aviallon.programs.compileFlags;
|
||||||
cxxflags = [ (attrs.CXXFLAGS or "") ] ++ config.aviallon.programs.compileFlags;
|
cxxflags = [ (attrs.CXXFLAGS or "") ] ++ config.aviallon.programs.compileFlags;
|
||||||
|
|
@ -26,6 +26,7 @@ let
|
||||||
cmakeFlags = mytrace "cmakeFlags" cmakeflags;
|
cmakeFlags = mytrace "cmakeFlags" cmakeflags;
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
});
|
});
|
||||||
|
optimizeForThisHost = if (cfg.optimizations) then (pkg: _optimizeForThisHost pkg) else (pkg: pkg);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.aviallon.overlays = {
|
options.aviallon.overlays = {
|
||||||
|
|
@ -35,6 +36,12 @@ in
|
||||||
description = "Wether to enable system-wide overlays or not";
|
description = "Wether to enable system-wide overlays or not";
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
};
|
};
|
||||||
|
optimizations = mkOption {
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
description = "Wether to enable CPU-specific optimizations for some packages or not";
|
||||||
|
type = types.bool;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
nix.nixPath =
|
nix.nixPath =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue