From 1184fa3d7e3165b7d52a7b61c9a0f14dc1062707 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Thu, 12 Jul 2018 19:29:35 +0000 Subject: [PATCH] Dump amount of used memory by guest --- nix/base.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nix/base.nix b/nix/base.nix index a770e60..f1aaff3 100644 --- a/nix/base.nix +++ b/nix/base.nix @@ -1,3 +1,4 @@ +{pkgs, ...}: { imports = [ @@ -39,6 +40,14 @@ startup = do spawn "spice-vdagent" ''; + environment.systemPackages = [ pkgs.bc ]; + services.cron = { + enable = true; + systemCronJobs = [ + "* * * * * root free -m | grep Mem | awk '{print $2 \"-\" $4}' | bc > /home/user/.memory_used" + ]; + }; + systemd.services.home-user-build-xmonad = { description = "Create and xmonad configuration"; serviceConfig = {