nixos/modules/services/log-to-ram/default.nix

25 lines
445 B
Nix
Raw Normal View History

2023-05-31 22:26:38 +02:00
{ config, lib, ... }:
2024-02-02 13:45:05 +01:00
let
cfg = config.services.az-log2ram;
in
{
2023-05-31 22:26:38 +02:00
options = {
services.az-log2ram.enable = lib.mkEnableOption "Enable log to RAM";
};
config = lib.mkIf cfg.enable {
fileSystems."/var/log" = {
device = "none";
fsType = "tmpfs";
2024-02-02 13:45:05 +01:00
options = [
"defaults"
"size=300M"
2024-02-02 13:45:05 +01:00
];
2023-05-31 22:26:38 +02:00
};
services.journald.extraConfig = ''
SystemMaxUse=300M
Storage=volatile
'';
2022-08-17 20:26:46 +02:00
};
}