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