Add support for specifying a build arch.
This commit is contained in:
parent
e4225a82bb
commit
2f05b9e600
@ -30,6 +30,7 @@
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver4";
|
||||
# build_arch = "x86-64-v3";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-skylake"
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver4";
|
||||
# build_arch = "x86-64-v3";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-znver5"
|
||||
|
||||
@ -24,6 +24,13 @@
|
||||
description = "The CPU arch for which programs should be optimized.";
|
||||
};
|
||||
|
||||
optimizations.build_arch = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
example = "znver4";
|
||||
description = "The CPU arch for which programs should be optimized.";
|
||||
};
|
||||
|
||||
optimizations.system_features = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
@ -61,14 +68,6 @@
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
|
||||
# Uncomment on of these to enable cross compiling:
|
||||
# nixpkgs.buildPlatform = builtins.currentSystem;
|
||||
# nixpkgs.buildPlatform = {
|
||||
# gcc.arch = "znver4";
|
||||
# gcc.tune = "znver4";
|
||||
# system = "x86_64-linux";
|
||||
# };
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(
|
||||
final: prev:
|
||||
@ -108,6 +107,18 @@
|
||||
}
|
||||
]
|
||||
))
|
||||
(lib.mkIf (config.me.optimizations.build_arch != null) (
|
||||
lib.mkMerge [
|
||||
{
|
||||
# Enable cross-compiling
|
||||
nixpkgs.buildPlatform = {
|
||||
gcc.arch = config.me.optimizations.build_arch;
|
||||
gcc.tune = "generic";
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
}
|
||||
]
|
||||
))
|
||||
(lib.mkIf (config.me.optimizations.system_features != [ ]) (
|
||||
lib.mkMerge [
|
||||
{
|
||||
|
||||
@ -171,7 +171,7 @@ in
|
||||
waybar = pkgs.symlinkJoin {
|
||||
name = prev.waybar.name;
|
||||
paths = [ prev.waybar ];
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/waybar --prefix PATH : ${
|
||||
lib.makeBinPath [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user