This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hosts/enyo: call custom kernel as a package
- Loading branch information
Showing
2 changed files
with
45 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{ | ||
imports = [ | ||
./config | ||
./package.nix | ||
]; | ||
{pkgs, ...}: let | ||
inherit (pkgs.callPackage ./package.nix {}) xanmod_custom; | ||
in { | ||
imports = [./config]; | ||
config = { | ||
modules.system.boot.kernel = pkgs.linuxPackagesFor xanmod_custom; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,51 @@ | ||
{ | ||
pkgs, | ||
lib, | ||
fetchFromGitHub, | ||
linuxKernel, | ||
ccacheStdenv, | ||
buildPackages, | ||
... | ||
}: let | ||
inherit (lib.kernel) yes no; | ||
inherit (lib.attrsets) mapAttrs; | ||
inherit (lib.attrsets) mapAttrs recursiveUpdate; | ||
inherit (lib.modules) mkForce; | ||
in { | ||
modules.system.boot.kernel = let | ||
version = "6.8.2"; | ||
suffix = "xanmod1"; | ||
modDirVersion = "${version}-${suffix}"; | ||
in | ||
pkgs.linuxKernel.kernels.linux_xanmod_latest.override { | ||
inherit version suffix modDirVersion; | ||
|
||
# https://github.com/xanmod/linux | ||
src = pkgs.fetchFromGitHub { | ||
owner = "xanmod"; | ||
repo = "linux"; | ||
rev = "refs/tags/${version}-xanmod1"; | ||
hash = "sha256-JddPg/EWJZq5EIemcaULM5c6yLGkfb2E6shxxq37N3M="; | ||
}; | ||
version = "6.8.2"; | ||
suffix = "xanmod1"; | ||
modDirVersion = "${version}-${suffix}"; | ||
|
||
xanmod_custom = linuxKernel.kernels.linux_xanmod_latest.override { | ||
inherit version suffix modDirVersion; | ||
|
||
# https://github.com/xanmod/linux | ||
src = fetchFromGitHub { | ||
owner = "xanmod"; | ||
repo = "linux"; | ||
rev = "refs/tags/${version}-xanmod1"; | ||
hash = "sha256-JddPg/EWJZq5EIemcaULM5c6yLGkfb2E6shxxq37N3M="; | ||
}; | ||
|
||
# poor attempt to make kernel builds use ccache | ||
stdenv = pkgs.ccacheStdenv; | ||
buildPackages = pkgs.buildPackages // {stdenv = pkgs.ccacheStdenv;}; | ||
# poor attempt to make kernel builds use ccache | ||
stdenv = ccacheStdenv; | ||
buildPackages = recursiveUpdate buildPackages { | ||
stdenv = ccacheStdenv; | ||
}; | ||
|
||
extraMakeFlags = ["KCFLAGS=-DAMD_PRIVATE_COLOR"]; | ||
ignoreConfigErrors = true; | ||
extraMakeFlags = ["KCFLAGS=-DAMD_PRIVATE_COLOR"]; | ||
ignoreConfigErrors = true; | ||
|
||
# after booting to the new kernel | ||
# use zcat /proc/config.gz | grep -i "<value>" | ||
# to check if the kernel options are set correctly | ||
extraStructuredConfig = mapAttrs (_: mkForce) { | ||
EXPERT = yes; | ||
DEBUG_KERNEL = no; | ||
WERROR = no; | ||
# after booting to the new kernel | ||
# use zcat /proc/config.gz | grep -i "<value>" | ||
# to check if the kernel options are set correctly | ||
extraStructuredConfig = mapAttrs (_: mkForce) { | ||
EXPERT = yes; | ||
DEBUG_KERNEL = no; | ||
WERROR = no; | ||
|
||
GCC_PLUGINS = yes; | ||
BUG_ON_DATA_CORRUPTION = yes; | ||
}; | ||
GCC_PLUGINS = yes; | ||
BUG_ON_DATA_CORRUPTION = yes; | ||
}; | ||
}; | ||
in { | ||
inherit xanmod_custom; | ||
} |