From 806448df1712351ba4b4afc68b04b9b8e465d4ad Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Sun, 5 Jan 2020 09:02:03 +0000 Subject: [PATCH] Memory autoballoon (host side) --- os/configuration.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/os/configuration.nix b/os/configuration.nix index 75d9c90..4762c7e 100644 --- a/os/configuration.nix +++ b/os/configuration.nix @@ -44,7 +44,21 @@ in { ''; }; - # TODO run ${appvm}/bin/appvm autoballoon each second + systemd.user.services."autoballoon" = { + serviceConfig.StartLimitBurst = 64; + script = "${appvm}/bin/appvm autoballoon"; + }; + + systemd.user.timers."autoballoon" = { + description = "Autoupdate resolution crutch"; + timerConfig = { + OnBootSec = "1s"; + OnUnitInactiveSec = "1s"; + Unit = "autoballoon.service"; + AccuracySec = "1us"; + }; + wantedBy = ["timers.target"]; + }; environment.systemPackages = with pkgs; [ appvm virtmanager chromium