This commit is contained in:
mjallen18
2026-01-02 11:55:52 -06:00
parent 1d5b1cf5e0
commit 0f42ffeebd
26 changed files with 69693 additions and 145 deletions

View File

@@ -65,21 +65,21 @@ in
libraspberrypi = super.${namespace}.libraspberrypi.override { stdenv = super.ccacheStdenv; }; libraspberrypi = super.${namespace}.libraspberrypi.override { stdenv = super.ccacheStdenv; };
raspberrypi-utils = super.${namespace}.raspberrypi-utils.override { stdenv = super.ccacheStdenv; }; raspberrypi-utils = super.${namespace}.raspberrypi-utils.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos = super.${namespace}.linuxPackages_cachyos.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos = super.${namespace}.linuxPackages_cachyos.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-lto = super.${namespace}.linuxPackages_cachyos-lto.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-lto = super.${namespace}.linuxPackages_cachyos-lto.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-lto-full = super.${namespace}.linuxPackages_cachyos-lto-full.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-lto-full = super.${namespace}.linuxPackages_cachyos-lto-full.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-lto-znver4 = super.${namespace}.linuxPackages_cachyos-lto-znver4.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-lto-znver4 = super.${namespace}.linuxPackages_cachyos-lto-znver4.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-server = super.${namespace}.linuxPackages_cachyos-server.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-server = super.${namespace}.linuxPackages_cachyos-server.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-server-lto = super.${namespace}.linuxPackages_cachyos-server-lto.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-server-lto = super.${namespace}.linuxPackages_cachyos-server-lto.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-server-lto-znver4 = super.${namespace}.linuxPackages_cachyos-server-lto-znver4.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-server-lto-znver4 = super.${namespace}.linuxPackages_cachyos-server-lto-znver4.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-rc = super.${namespace}.linuxPackages_cachyos-rc.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-rc = super.${namespace}.linuxPackages_cachyos-rc.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-rc-lto = super.${namespace}.linuxPackages_cachyos-rc-lto.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-rc-lto = super.${namespace}.linuxPackages_cachyos-rc-lto.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-rc-lto-znver4 = super.${namespace}.linuxPackages_cachyos-rc-lto-znver4.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-rc-lto-znver4 = super.${namespace}.linuxPackages_cachyos-rc-lto-znver4.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-hardened = super.${namespace}.linuxPackages_cachyos-hardened.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-hardened = super.${namespace}.linuxPackages_cachyos-hardened.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-hardened-lto = super.${namespace}.linuxPackages_cachyos-hardened-lto.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-hardened-lto = super.${namespace}.linuxPackages_cachyos-hardened-lto.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-hardened-lto-znver4 = super.${namespace}.linuxPackages_cachyos-hardened-lto-znver4.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-hardened-lto-znver4 = super.${namespace}.linuxPackages_cachyos-hardened-lto-znver4.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-deckify = super.${namespace}.linuxPackages_cachyos-deckify.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-deckify = super.${namespace}.linuxPackages_cachyos-deckify.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-deckify-lto = super.${namespace}.linuxPackages_cachyos-deckify-lto.override { stdenv = super.ccacheStdenv; }; # linuxPackages_cachyos-deckify-lto = super.${namespace}.linuxPackages_cachyos-deckify-lto.override { stdenv = super.ccacheStdenv; };
}; };
}) })

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -15,16 +15,23 @@ let
inherit (stdenv) isx86_64 isAarch64 isLinux; inherit (stdenv) isx86_64 isAarch64 isLinux;
inherit (lib.trivial) importJSON; inherit (lib.trivial) importJSON;
# CachyOS repeating stuff. arch = (if isx86_64 then "x86_64" else "aarch64");
# ######################################################
# Source Versions #
# ######################################################
mainVersions = importJSON ./versions.json; mainVersions = importJSON ./versions.json;
ltsVersions = importJSON ./versions-lts.json; ltsVersions = importJSON ./versions-lts.json;
rcVersions = importJSON ./versions-rc.json; rcVersions = importJSON ./versions-rc.json;
hardenedVersions = importJSON ./versions-hardened.json; hardenedVersions = importJSON ./versions-hardened.json;
# ######################################################
# Base LTO Config #
# ######################################################
ltoKernelAttrs = { ltoKernelAttrs = {
taste = "linux-cachyos"; taste = "linux-cachyos";
pname = "cachyos-lto"; pname = "cachyos-lto";
configPath = ./config-nix/cachyos-lto.x86_64-linux.nix; configPath = ./config-nix/${arch}-linux/cachyos-lto.${arch}-linux.nix;
# Pass the unified arguments (including the resolved 'self') to llvm-pkgs # Pass the unified arguments (including the resolved 'self') to llvm-pkgs
inherit (import ./lib/llvm-pkgs.nix (args // { inherit self; })) callPackage; inherit (import ./lib/llvm-pkgs.nix (args // { inherit self; })) callPackage;
@@ -67,10 +74,10 @@ let
useLTO = "full"; useLTO = "full";
}; };
serverLtoKernelAttrs = { serverLtoKernelAttrs = ltoKernelAttrs // {
taste = "linux-cachyos-server"; taste = "linux-cachyos-server";
pname = "cachyos-server-lto"; pname = "cachyos-server-lto";
configPath = ./config-nix/cachyos-server-lto.x86_64-linux.nix; configPath = ./config-nix/${arch}-linux/cachyos-server-lto.${arch}-linux.nix;
basicCachy = false; basicCachy = false;
cpuSched = "eevdf"; cpuSched = "eevdf";
ticksHz = 300; ticksHz = 300;
@@ -80,43 +87,12 @@ let
withDAMON = true; withDAMON = true;
withNTSync = false; withNTSync = false;
withHDR = false; withHDR = false;
# Pass the unified arguments (including the resolved 'self') to llvm-pkgs
inherit (import ./lib/llvm-pkgs.nix (args // { inherit self; })) callPackage;
useLTO = "thin";
packagesExtend = import ./lib/llvm-module-overlay.nix args;
zfsOverride = {
inherit (pkgs)
autoreconfHook269
util-linux
coreutils
perl
udevCheckHook
zlib
libuuid
python3
attr
openssl
libtirpc
nfs-utils
gawk
gnugrep
gnused
systemd
smartmontools
sysstat
pkg-config
curl
pam
nix-update-script
;
};
description = "Linux EEVDF-BORE scheduler Kernel by CachyOS built with LLVM and Thin LTO";
}; };
# ######################################################
# Misc Utils #
# ######################################################
# Evaluation hack # Evaluation hack
brokenReplacement = pkgs.hello.overrideAttrs (prevAttrs: { brokenReplacement = pkgs.hello.overrideAttrs (prevAttrs: {
meta = prevAttrs.meta // { meta = prevAttrs.meta // {
@@ -148,29 +124,23 @@ let
// attrs // attrs
); );
gccKernel = mkCachyKernel { # ######################################################
# Base GCC Config #
# ######################################################
gccKernelAttrs = {
taste = "linux-cachyos"; taste = "linux-cachyos";
pname = "cachyos-gcc"; pname = "cachyos-gcc";
configPath = ( if isx86_64 then ./config-nix/cachyos-gcc.x86_64-linux.nix else ./config-nix/cachyos-gcc.aarch64-linux.nix); configPath = ./config-nix/${arch}-linux/cachyos-gcc.${arch}-linux.nix;
# since all flavors use the same versions.json, we just need the updateScript in one of them # since all flavors use the same versions.json, we just need the updateScript in one of them
withUpdateScript = "stable"; withUpdateScript = "stable";
}; };
in
{
inherit
mainVersions
rcVersions
hardenedVersions
mkCachyKernel
;
cachyos-gcc = gccKernel; # ######################################################
# Base LTS Config #
cachyos-lts = mkCachyKernel { # ######################################################
taste = "linux-cachyos-lts";
pname = "cachyos-lts";
configPath = ./config-nix/cachyos-lts.x86_64-linux.nix;
ltsAttrs = {
versions = ltsVersions; versions = ltsVersions;
withUpdateScript = "lts"; withUpdateScript = "lts";
@@ -180,11 +150,11 @@ in
prev // { recurseForDerivations = false; }; prev // { recurseForDerivations = false; };
}; };
cachyos-rc = mkCachyKernel { # ######################################################
taste = "linux-cachyos-rc"; # Base RC Config #
pname = "cachyos-rc"; # ######################################################
configPath = ./config-nix/cachyos-rc.x86_64-linux.nix;
rcAttrs = {
versions = rcVersions; versions = rcVersions;
withUpdateScript = "rc"; withUpdateScript = "rc";
@@ -193,57 +163,12 @@ in
_kernel: _final: prev: _kernel: _final: prev:
prev // { recurseForDerivations = false; }; prev // { recurseForDerivations = false; };
}; };
cachyos-lto = mkCachyKernel ltoKernelAttrs;
cachyos-lto-full = mkCachyKernel ltoFullKernelAttrs;
cachyos-lto-znver4 = mkCachyKernel ( # ######################################################
ltoKernelAttrs # Base Server Config #
// { # ######################################################
pname = "cachyos-lto-znver4";
configPath = ./config-nix/cachyos-znver4.x86_64-linux.nix;
}
);
cachyos-rc-lto = mkCachyKernel ( serverAttrs = {
ltoKernelAttrs
// {
taste = "linux-cachyos-rc";
pname = "cachyos-rc-lto";
configPath = ./config-nix/cachyos-rc-lto.x86_64-linux.nix;
versions = rcVersions;
withUpdateScript = "rc";
# Prevent building kernel modules for rc kernel
packagesExtend =
_kernel: _final: prev:
prev // { recurseForDerivations = false; };
}
);
cachyos-rc-lto-znver4 = mkCachyKernel (
ltoKernelAttrs
// {
taste = "linux-cachyos-rc";
pname = "cachyos-rc-lto-znver4";
configPath = ./config-nix/cachyos-rc-znver4.x86_64-linux.nix;
versions = rcVersions;
withUpdateScript = "rc";
# Prevent building kernel modules for rc kernel
packagesExtend =
_kernel: _final: prev:
prev // { recurseForDerivations = false; };
}
);
cachyos-sched-ext = throw "\"sched-ext\" patches were merged with \"cachyos\" flavor.";
cachyos-server = mkCachyKernel {
taste = "linux-cachyos-server";
pname = "cachyos-server";
configPath = ./config-nix/cachyos-server.x86_64-linux.nix;
basicCachy = false; basicCachy = false;
cpuSched = "eevdf"; cpuSched = "eevdf";
ticksHz = 300; ticksHz = 300;
@@ -256,20 +181,11 @@ in
description = "Linux EEVDF scheduler Kernel by CachyOS targeted for Servers"; description = "Linux EEVDF scheduler Kernel by CachyOS targeted for Servers";
}; };
cachyos-server-lto = mkCachyKernel serverLtoKernelAttrs; # ######################################################
# Base Hardened Config #
# ######################################################
cachyos-server-lto-znver4 = mkCachyKernel ( hardenedAttrs = {
serverLtoKernelAttrs
// {
configPath = ./config-nix/cachyos-znver4.x86_64-linux.nix;
pname = "cachyos-server-lto-znver4";
}
);
cachyos-hardened = mkCachyKernel {
taste = "linux-cachyos-hardened";
pname = "cachyos-hardened";
configPath = ./config-nix/cachyos-hardened.x86_64-linux.nix;
cpuSched = "hardened"; cpuSched = "hardened";
versions = hardenedVersions; versions = hardenedVersions;
@@ -278,23 +194,127 @@ in
withNTSync = false; withNTSync = false;
withHDR = false; withHDR = false;
}; };
in
{
inherit
mainVersions
rcVersions
hardenedVersions
mkCachyKernel
;
cachyos-deckify = mkCachyKernel { # ######################################################
# GCC Kernels #
# ######################################################
# Base GCC
cachyos-gcc = mkCachyKernel gccKernelAttrs;
# GCC LTS
cachyos-lts = mkCachyKernel (gccKernelAttrs // ltsAttrs // {
taste = "linux-cachyos-lts";
pname = "cachyos-lts";
configPath = ./config-nix/${arch}-linux/cachyos-lts.${arch}-linux.nix;
});
# GCC RC
cachyos-rc = mkCachyKernel (gccKernelAttrs // rcAttrs // {
taste = "linux-cachyos-rc";
pname = "cachyos-rc";
configPath = ./config-nix/${arch}-linux/cachyos-rc.${arch}-linux.nix;
});
# Server GCC
cachyos-server = mkCachyKernel gccKernelAttrs // serverAttrs // ({
taste = "linux-cachyos-server";
pname = "cachyos-server";
configPath = ./config-nix/${arch}-linux/cachyos-server.${arch}-linux.nix;
});
# Hardened GCC
cachyos-hardened = mkCachyKernel (gccKernelAttrs // hardenedAttrs // {
taste = "linux-cachyos-hardened";
pname = "cachyos-hardened";
configPath = ./config-nix/${arch}-linux/cachyos-hardened.${arch}-linux.nix;
});
# Deckify GCC
cachyos-deckify = mkCachyKernel (gccKernelAttrs // {
taste = "linux-cachyos-deckify"; taste = "linux-cachyos-deckify";
pname = "cachyos-deckify"; pname = "cachyos-deckify";
configPath = ./config-nix/cachyos-deckify.x86_64-linux.nix; configPath = ./config-nix/${arch}-linux/cachyos-deckify.${arch}-linux.nix;
});
versions = mainVersions; # ######################################################
withUpdateScript = "stable"; # LTO Kernels #
# ######################################################
# Base LTO
cachyos-lto = mkCachyKernel ltoKernelAttrs;
# LTO Full
cachyos-lto-full = mkCachyKernel (ltoKernelAttrs // {
configPath = ./config-nix/cachyos-lto.x86_64-linux.nix;
useLTO = "full";
});
# LTO Zen Version 4
cachyos-lto-znver4 = mkCachyKernel (
ltoKernelAttrs
// {
pname = "cachyos-lto-znver4";
configPath = ./config-nix/${arch}-linux/cachyos-znver4.${arch}-linux.nix;
}
);
# RC LTO
cachyos-rc-lto = mkCachyKernel (
ltoKernelAttrs
// rcAttrs // {
taste = "linux-cachyos-rc";
pname = "cachyos-rc-lto";
configPath = ./config-nix/${arch}-linux/cachyos-rc-lto.${arch}-linux.nix;
}
);
# RC LTO Zen Version 4
cachyos-rc-lto-znver4 = mkCachyKernel (
ltoKernelAttrs
// rcAttrs // {
taste = "linux-cachyos-rc";
pname = "cachyos-rc-lto-znver4";
configPath = ./config-nix/${arch}-linux/cachyos-rc-lto-znver4.${arch}-linux.nix;
}
);
# Server LTO
cachyos-server-lto = mkCachyKernel ltoKernelAttrs // serverAttrs // {
taste = "linux-cachyos-server";
pname = "cachyos-server-lto";
configPath = ./config-nix/${arch}-linux/cachyos-server-lto.${arch}-linux.nix;
}; };
cachyos-deckify-lto = mkCachyKernel ltoKernelAttrs // { # Server LTO Zen Version 4
cachyos-server-lto-znver4 = mkCachyKernel (
serverLtoKernelAttrs
// {
configPath = ./config-nix/${arch}-linux/cachyos-server-znver4.${arch}-linux.nix;
pname = "cachyos-server-lto-znver4";
}
);
# Deckify LTO
cachyos-deckify-lto = mkCachyKernel (ltoKernelAttrs // {
pname = "linux-cachyos-deckify-lto"; pname = "linux-cachyos-deckify-lto";
configPath = ./config-nix/cachyos-deckify-lto.x86_64-linux.nix; configPath = ./config-nix/${arch}-linux/cachyos-deckify-lto.${arch}-linux.nix;
}; });
# ######################################################
# Cachy ZFZ #
# ######################################################
zfs = zfs_2_3.overrideAttrs (prevAttrs: { zfs = zfs_2_3.overrideAttrs (prevAttrs: {
src = if isUnsupported then brokenReplacement else gccKernel.zfs_cachyos.src; src = if isUnsupported then brokenReplacement else (mkCachyKernel gccKernelAttrs).zfs_cachyos.src;
patches = [ ]; patches = [ ];
passthru = prevAttrs.passthru // { passthru = prevAttrs.passthru // {
kernelModuleAttribute = "zfs_cachyos"; kernelModuleAttribute = "zfs_cachyos";

View File

@@ -14,7 +14,7 @@ in
# variant = "4"; # variant = "4";
# }; # };
# kernelPackages = kernelBundle.linuxPackages_rpi4; # kernelPackages = kernelBundle.linuxPackages_rpi4;
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.${namespace}.linuxPackages_cachyos-lto;
supportedFilesystems = lib.mkForce [ ]; supportedFilesystems = lib.mkForce [ ];
}; };