mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 07:08:45 +08:00
整理 system.march
This commit is contained in:
parent
6017698731
commit
485d107a3b
@ -214,6 +214,7 @@
|
||||
system =
|
||||
{
|
||||
hostname = "chn-PC";
|
||||
march = "alderlake";
|
||||
};
|
||||
};}
|
||||
)
|
||||
|
@ -2,7 +2,6 @@ inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
nixpkgs.hostPlatform = inputs.lib.mkDefault "x86_64-linux";
|
||||
nix =
|
||||
{
|
||||
settings =
|
||||
|
@ -14,8 +14,6 @@ inputs:
|
||||
patch = null;
|
||||
extraStructuredConfig =
|
||||
{
|
||||
GENERIC_CPU = inputs.lib.kernel.no;
|
||||
MALDERLAKE = inputs.lib.kernel.yes;
|
||||
PREEMPT_VOLUNTARY = inputs.lib.mkForce inputs.lib.kernel.no;
|
||||
PREEMPT = inputs.lib.mkForce inputs.lib.kernel.yes;
|
||||
HZ_500 = inputs.lib.mkForce inputs.lib.kernel.no;
|
||||
|
@ -2,10 +2,9 @@
|
||||
{
|
||||
config =
|
||||
{
|
||||
nix.settings.system-features = [ "nixos-test" "benchmark" "kvm" "gccarch-alderlake" ];
|
||||
nix.settings.system-features = [ "nixos-test" "benchmark" "kvm" ];
|
||||
nixpkgs =
|
||||
{
|
||||
hostPlatform = { system = "x86_64-linux"; gcc = { arch = "alderlake"; tune = "alderlake"; }; };
|
||||
config.allowUnfree = true;
|
||||
overlays =
|
||||
[(
|
||||
@ -22,7 +21,6 @@
|
||||
fwupd = generic-pkgs.fwupd;
|
||||
}
|
||||
)];
|
||||
config.qchem-config.optArch = "alderlake";
|
||||
};
|
||||
services.dbus.implementation = "broker";
|
||||
programs.dconf.enable = true;
|
||||
|
@ -3,6 +3,7 @@ inputs:
|
||||
options.nixos.system = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
hostname = mkOption { type = types.nonEmptyStr; };
|
||||
march = mkOption { type = types.nullOr types.nonEmptyStr; };
|
||||
};
|
||||
config = let inherit (inputs.lib) mkMerge mkIf; inherit (inputs.localLib) mkConditional stripeTabs; in mkMerge
|
||||
[
|
||||
@ -21,5 +22,29 @@ inputs:
|
||||
}
|
||||
# hostname
|
||||
{ networking.hostName = inputs.config.nixos.system.hostname; }
|
||||
# march
|
||||
(
|
||||
mkConditional (inputs.config.nixos.system.march != null)
|
||||
{
|
||||
nixpkgs =
|
||||
{
|
||||
hostPlatform = { system = "x86_64-linux"; gcc =
|
||||
{ arch = inputs.config.nixos.system.march; tune = inputs.config.nixos.system.march; }; };
|
||||
config.qchem-config.optArch = inputs.config.nixos.system.march;
|
||||
};
|
||||
nix.settings.system-features = [ "gccarch-${inputs.config.nixos.system.march}" ];
|
||||
boot.kernelPatches =
|
||||
[{
|
||||
name = "native kernel";
|
||||
patch = null;
|
||||
extraStructuredConfig =
|
||||
{
|
||||
GENERIC_CPU = inputs.lib.kernel.no;
|
||||
"M${inputs.lib.strings.toUpper inputs.config.nixos.system.march}" = inputs.lib.kernel.yes;
|
||||
};
|
||||
}];
|
||||
}
|
||||
{ nixpkgs.hostPlatform = inputs.lib.mkDefault "x86_64-linux"; }
|
||||
)
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user