reorganization

This commit is contained in:
Reid 2026-04-22 23:21:23 -07:00
parent 2ad77494b2
commit b6afba390b
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
24 changed files with 144 additions and 128 deletions

27
modules/core/kernel.nix Normal file
View file

@ -0,0 +1,27 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.core.kernel;
in {
options.modules.core.kernel = {
zswap = mkEnableOption "Enable zswap, a compressed RAM cache for swap pages";
v4l2 = mkEnableOption "Enable support for v4l2 loopback devices";
};
config = mkMerge [
(mkIf cfg.zswap {
boot.kernelParams = [
"zswap.enabled=1"
"zswap.shrinker_enabled=1"
"zswap.max_pool_percent=20"
"zswap.compressor=zstd"
"zswap.zpool=zsmalloc"
];
})
(mkIf cfg.v4l2 {
boot.kernelModules = ["v4l2loopback"];
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
})
];
}