reorganization
This commit is contained in:
parent
2ad77494b2
commit
b6afba390b
24 changed files with 144 additions and 128 deletions
27
modules/core/kernel.nix
Normal file
27
modules/core/kernel.nix
Normal 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 ];
|
||||
})
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue