From cba4091589019b25d978f317b9ecd8a8f5e4c739 Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Tue, 31 Oct 2023 14:49:36 +0100 Subject: [PATCH] [General] add cpu options to specify informations about cache sizes, etc. --- general.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/general.nix b/general.nix index 6647cc6..d564757 100644 --- a/general.nix +++ b/general.nix @@ -56,6 +56,33 @@ in type = types.str; }; + caches = { + l1d = mkOption { + default = null; + example = 64; + description = "CPU L1 (data) cache size in kB"; + type = with types; nullOr ints.positive; + }; + l1i = mkOption { + default = null; + example = 64; + description = "CPU L1 (instruction) cache size in kB"; + type = with types; nullOr ints.positive; + }; + lastLevel = mkOption { + default = null; + example = 1024; + description = "Last-level (typ. L3) CPU cache size in kB"; + type = with types; nullOr ints.positive; + }; + cacheLine = mkOption { + default = null; + example = 64; + description = lib.mdDoc "Cache-line size in bytes (can be retrieved using `/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size`)"; + type = with types; nullOr ints.positive; + }; + }; + x86 = { level = mkOption { default = 1;