nixos/chrony: add enableMemoryLocking option

Fixes #222629.
This commit is contained in:
Franz Pletz 2023-08-10 01:40:47 +02:00
parent cef068f3b3
commit c13c1412bf
No known key found for this signature in database
GPG Key ID: 846FDED7792617B4

View File

@ -27,7 +27,10 @@ let
${cfg.extraConfig}
'';
chronyFlags = [ "-n" "-m" "-u" "chrony" "-f" "${configFile}" ] ++ cfg.extraFlags;
chronyFlags =
[ "-n" "-u" "chrony" "-f" "${configFile}" ]
++ optional cfg.enableMemoryLocking "-m"
++ cfg.extraFlags;
in
{
options = {
@ -73,6 +76,15 @@ in
'';
};
enableMemoryLocking = mkOption {
type = types.bool;
default = config.environment.memoryAllocator.provider != "graphene-hardened";
defaultText = ''config.environment.memoryAllocator.provider != "graphene-hardened"'';
description = lib.mdDoc ''
Whether to add the `-m` flag to lock memory.
'';
};
enableNTS = mkOption {
type = types.bool;
default = false;