mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Boot] Add kernel config option to aviallon namespace
Allows advanced patching / overriding of the kernel while still allowing to set the kernel in other modules.
This commit is contained in:
parent
3f22bcff49
commit
91c5ba1e69
3 changed files with 13 additions and 5 deletions
14
boot.nix
14
boot.nix
|
|
@ -1,4 +1,4 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{ config, pkgs, lib, options, ... }:
|
||||
with lib;
|
||||
let
|
||||
customKernelPatches = {
|
||||
|
|
@ -81,8 +81,7 @@ let
|
|||
allowUnfree = (types.isType types.attrs config.nixpkgs.config)
|
||||
&& (hasAttr "allowUnfree" config.nixpkgs.config)
|
||||
&& (getAttr "allowUnfree" config.nixpkgs.config);
|
||||
in
|
||||
{
|
||||
in {
|
||||
|
||||
options.aviallon.boot = {
|
||||
enable = mkOption {
|
||||
|
|
@ -130,6 +129,13 @@ in
|
|||
example = { "i915.fastboot" = true; };
|
||||
type = types.attrsOf (types.oneOf [ types.bool types.int types.str (types.listOf types.str) ]);
|
||||
};
|
||||
|
||||
kernel = mkOption {
|
||||
description = "Linux kernel to use";
|
||||
default = options.boot.kernelPackages.default.kernel;
|
||||
example = "pkgs.kernel";
|
||||
type = types.package;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -158,6 +164,8 @@ in
|
|||
initrd.kernelModules = [ ];
|
||||
initrd.availableKernelModules = [ "ehci_pci" ];
|
||||
|
||||
kernelPackages = pkgs.linuxPackagesFor cfg.kernel;
|
||||
|
||||
kernelPatches = []
|
||||
++ optional cfg.x32abi.enable customKernelPatches.enableX32ABI
|
||||
++ optional cfg.rtGroupSched.enable customKernelPatches.enableRTGroupSched
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue