mirror of
https://github.com/librephoenix/nixos-config
synced 2025-10-19 01:54:02 +05:30
Major config overhaul: use custom modules, setup for multi-host config, and less boilerplate
This commit is contained in:
parent
1fa8b17b07
commit
0453901d17
303 changed files with 3560 additions and 5566 deletions
29
modules/system/kernel/default.nix
Normal file
29
modules/system/kernel/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.systemSettings.cachy;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
systemSettings.cachy = {
|
||||
enable = lib.mkEnableOption "Enable cachyos kernel";
|
||||
variant = lib.mkOption {
|
||||
default = null;
|
||||
type = lib.types.nullOr (lib.types.enum ["lto" "server" "hardened"]);
|
||||
description = ''
|
||||
This option determines the CachyOS kernel variant to use.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
boot.kernelPackages = lib.mkMerge [
|
||||
(lib.mkIf (cfg.variant == null) pkgs.linuxPackages_cachyos)
|
||||
(lib.mkIf (cfg.variant == "lto") pkgs.linuxPackages_cachyos-lto)
|
||||
(lib.mkIf (cfg.variant == "server") pkgs.linuxPackages_cachyos-server)
|
||||
(lib.mkIf (cfg.variant == "hardened") pkgs.linuxPackages_cachyos-hardened)
|
||||
];
|
||||
boot.consoleLogLevel = 0;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue