initial commit
All checks were successful
Deploy docs / build-and-deploy (push) Successful in 3s

This commit is contained in:
sid 2026-02-23 20:34:35 +01:00
commit 95a533c876
451 changed files with 18255 additions and 0 deletions

View file

@ -0,0 +1,45 @@
{
config,
lib,
...
}:
let
cfg = config.virtualisation.hugepages;
inherit (lib)
mkEnableOption
mkOption
optionals
types
;
in
{
options.virtualisation.hugepages = {
enable = mkEnableOption "huge pages.";
defaultPageSize = mkOption {
type = types.strMatching "[0-9]*[kKmMgG]";
default = "1M";
description = "Default size of huge pages. You can use suffixes K, M, and G to specify KB, MB, and GB.";
};
pageSize = mkOption {
type = types.strMatching "[0-9]*[kKmMgG]";
default = "1M";
description = "Size of huge pages that are allocated at boot. You can use suffixes K, M, and G to specify KB, MB, and GB.";
};
numPages = mkOption {
type = types.ints.positive;
default = 1;
description = "Number of huge pages to allocate at boot.";
};
};
config.boot.kernelParams = optionals cfg.enable [
"default_hugepagesz=${cfg.defaultPageSize}"
"hugepagesz=${cfg.pageSize}"
"hugepages=${toString cfg.numPages}"
];
}