Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
hosts/enyo: call custom kernel as a package
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf committed Mar 31, 2024
1 parent 2f1d9ad commit 54ae2ef
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 37 deletions.
12 changes: 7 additions & 5 deletions hosts/enyo/kernel/default.nix
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;
};
}
70 changes: 38 additions & 32 deletions hosts/enyo/kernel/package.nix
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;
}

0 comments on commit 54ae2ef

Please sign in to comment.