Change to kernel patch for mini build
This commit is contained in:
parent
7148614dc5
commit
84b48a9a6c
3 changed files with 33 additions and 116 deletions
|
@ -107,15 +107,32 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
specialisation.linux-cachy-mini.configuration = {
|
specialisation.linux-cachy-mini.configuration = {
|
||||||
boot.kernelPackages = lib.mkForce (import ./mini_kernel.nix {
|
boot.kernelPatches = [
|
||||||
|
(import ./mini_kernel.nix {
|
||||||
inherit inputs lib;
|
inherit inputs lib;
|
||||||
pkgs = pkgs.pkgsAMD64Microarchs.znver4;
|
pkgs = pkgs.pkgsAMD64Microarchs.znver4;
|
||||||
});
|
}).patch
|
||||||
|
];
|
||||||
|
|
||||||
environment.etc."specialisation".text = "linux-cachy-mini";
|
environment.etc."specialisation".text = "linux-cachy-mini";
|
||||||
system.nixos.tags = [ "linux-cachy-mini" ];
|
system.nixos.tags = [ "linux-cachy-mini" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
# specialisation.linux-cachy-mini-lto.configuration = {
|
||||||
|
# boot.kernelPackages = lib.mkForce pkgs.pkgsAMD64Microarchs.znver4.linuxPackages_cachyos-lto;
|
||||||
|
# boot.kernelPatches = [
|
||||||
|
# (import ./mini_kernel.nix {
|
||||||
|
# inherit inputs lib;
|
||||||
|
# pkgs = pkgs.pkgsAMD64Microarchs.znver4;
|
||||||
|
# }).patch
|
||||||
|
# ];
|
||||||
|
# environment.etc."specialisation".text = "linux-cachy-mini-lto";
|
||||||
|
# system.nixos.tags = [ "linux-cachy-mini-lto" ];
|
||||||
|
# };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
# kernelPackages = pkgs.linuxPackages_cachyos; # bootstrap
|
# kernelPackages = pkgs.linuxPackages_cachyos; # bootstrap
|
||||||
kernelPackages = pkgs.pkgsAMD64Microarchs.znver4.linuxPackages_cachyos;
|
kernelPackages = pkgs.pkgsAMD64Microarchs.znver4.linuxPackages_cachyos;
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
mainVersions = lib.importJSON "${inputs.chaotic}/pkgs/linux-cachyos/versions.json";
|
|
||||||
mainConfig = import "${inputs.chaotic}/pkgs/linux-cachyos/config-nix/cachyos.x86_64-linux.nix";
|
mainConfig = import "${inputs.chaotic}/pkgs/linux-cachyos/config-nix/cachyos.x86_64-linux.nix";
|
||||||
usedModules = builtins.readFile ./modprobed.db;
|
usedModules = builtins.readFile ./modprobed.db;
|
||||||
toLowerParts = list: (lib.lists.unique
|
toLowerParts = list: (lib.lists.unique
|
||||||
|
@ -36,12 +35,17 @@ let
|
||||||
})
|
})
|
||||||
(builtins.attrValues (builtins.mapAttrs (name: value: { inherit name value; }) mainConfig))
|
(builtins.attrValues (builtins.mapAttrs (name: value: { inherit name value; }) mainConfig))
|
||||||
);
|
);
|
||||||
mkCachyKernel = attrs: pkgs.callPackage ./pkgs-for.nix ({ versions = mainVersions; } // attrs);
|
patchConfigStep1 = lib.attrsets.mapAttrs ((name: value: {
|
||||||
mainKernel = mkCachyKernel {
|
${builtins.removePrefix "CONFIG_" name} = value;
|
||||||
inherit inputs;
|
})
|
||||||
taste = "linux-cachyos";
|
filteredConfig);
|
||||||
kConfig = filteredConfig;
|
patchConfigFinal = lib.attrsets.filterAttrs ((n: v: v == "n") patchConfigStep1);
|
||||||
withUpdateScript = "stable";
|
patch = {
|
||||||
|
name = "disable-unused-kmods";
|
||||||
|
patch = null;
|
||||||
|
extraStructuredConfig = patchConfigFinal;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
mainKernel
|
{
|
||||||
|
patch = patch;
|
||||||
|
}
|
||||||
|
|
|
@ -1,104 +0,0 @@
|
||||||
{ stdenv
|
|
||||||
, inputs
|
|
||||||
, taste
|
|
||||||
, kConfig
|
|
||||||
, versions
|
|
||||||
, callPackage
|
|
||||||
, linuxPackages
|
|
||||||
, linuxPackagesFor
|
|
||||||
, fetchFromGitHub
|
|
||||||
, nyxUtils
|
|
||||||
, lib
|
|
||||||
, ogKernelConfigfile ? linuxPackages.kernel.passthru.configfile
|
|
||||||
, # those are set in their PKGBUILDs
|
|
||||||
kernelPatches ? { }
|
|
||||||
, basicCachy ? true
|
|
||||||
, cpuSched ? "cachyos"
|
|
||||||
, useLTO ? "none"
|
|
||||||
, ticksHz ? 500
|
|
||||||
, tickRate ? "full"
|
|
||||||
, preempt ? "full"
|
|
||||||
, hugePages ? "always"
|
|
||||||
, withDAMON ? false
|
|
||||||
, withNTSync ? true
|
|
||||||
, withHDR ? true
|
|
||||||
, withoutDebug ? false
|
|
||||||
, description ? "Linux EEVDF-BORE scheduler Kernel by CachyOS with other patches and improvements"
|
|
||||||
, withUpdateScript ? null
|
|
||||||
, packagesExtend ? null
|
|
||||||
,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
cachyConfig = {
|
|
||||||
inherit
|
|
||||||
taste
|
|
||||||
versions
|
|
||||||
basicCachy
|
|
||||||
cpuSched
|
|
||||||
useLTO
|
|
||||||
ticksHz
|
|
||||||
tickRate
|
|
||||||
preempt
|
|
||||||
hugePages
|
|
||||||
withDAMON
|
|
||||||
withNTSync
|
|
||||||
withHDR
|
|
||||||
withoutDebug
|
|
||||||
description
|
|
||||||
withUpdateScript
|
|
||||||
;
|
|
||||||
};
|
|
||||||
|
|
||||||
# The three phases of the config
|
|
||||||
# - First we apply the changes fromt their PKGBUILD using kconfig;
|
|
||||||
# - Then we NIXify it (in the update-script);
|
|
||||||
# - Last state is importing the NIXified version for building.
|
|
||||||
preparedConfigfile = callPackage "${inputs.chaotic}/pkgs/linux-cachyos/prepare.nix" {
|
|
||||||
inherit cachyConfig stdenv kernel ogKernelConfigfile;
|
|
||||||
};
|
|
||||||
kconfigToNix = callPackage "${inputs.chaotic}/pkgs/linux-cachyos/lib/kconfig-to-nix.nix" {
|
|
||||||
configfile = preparedConfigfile;
|
|
||||||
};
|
|
||||||
linuxConfigTransfomed = kConfig;
|
|
||||||
|
|
||||||
kernel = callPackage "${inputs.chaotic}/pkgs/linux-cachyos/kernel.nix" {
|
|
||||||
inherit cachyConfig stdenv kconfigToNix;
|
|
||||||
kernelPatches = [ ];
|
|
||||||
configfile = preparedConfigfile;
|
|
||||||
config = linuxConfigTransfomed;
|
|
||||||
};
|
|
||||||
|
|
||||||
# CachyOS repeating stuff.
|
|
||||||
addZFS = _finalAttrs: prevAttrs: {
|
|
||||||
kernel_configfile = prevAttrs.kernel.configfile;
|
|
||||||
zfs_cachyos = prevAttrs.zfs_unstable.overrideAttrs (prevAttrs: {
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "cachyos";
|
|
||||||
repo = "zfs";
|
|
||||||
inherit (versions.zfs) rev hash;
|
|
||||||
};
|
|
||||||
meta = prevAttrs.meta // { broken = false; };
|
|
||||||
patches = [ ];
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
basePackages = linuxPackagesFor kernel;
|
|
||||||
packagesWithZFS = basePackages.extend addZFS;
|
|
||||||
packagesWithExtend =
|
|
||||||
if packagesExtend == null
|
|
||||||
then packagesWithZFS
|
|
||||||
else packagesWithZFS.extend (packagesExtend kernel);
|
|
||||||
packagesWithoutZFS = removeAttrs packagesWithExtend [ "zfs" "zfs_2_1" "zfs_2_2" "zfs_unstable" ];
|
|
||||||
packagesWithoutUpdateScript = nyxUtils.dropAttrsUpdateScript packagesWithoutZFS;
|
|
||||||
packagesWithRightPlatforms = nyxUtils.setAttrsPlatforms supportedPlatforms packagesWithoutUpdateScript;
|
|
||||||
|
|
||||||
supportedPlatforms = [ (with lib.systems.inspect.patterns; isx86_64 // isLinux) "x86_64-linux" ];
|
|
||||||
|
|
||||||
versionSuffix = "+C${nyxUtils.shorter versions.config.rev}+P${nyxUtils.shorter versions.patches.rev}";
|
|
||||||
in
|
|
||||||
packagesWithRightPlatforms
|
|
||||||
// {
|
|
||||||
_description = "Kernel and modules for ${description}";
|
|
||||||
_version = "${versions.linux.version}${versionSuffix}";
|
|
||||||
inherit (basePackages) kernel; # This one still has the updateScript
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue