mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-12-25 12:29:48 +00:00
parent
e7cc81694b
commit
8a93015bfe
30
base.nix.go
30
base.nix.go
@ -40,14 +40,6 @@ startup = do
|
|||||||
spawn "${pkgs.spice-vdagent}/bin/spice-vdagent"
|
spawn "${pkgs.spice-vdagent}/bin/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 = {
|
systemd.services.home-user-build-xmonad = {
|
||||||
description = "Link xmonad configuration";
|
description = "Link xmonad configuration";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
@ -89,5 +81,27 @@ startup = do
|
|||||||
};
|
};
|
||||||
wantedBy = ["timers.target"];
|
wantedBy = ["timers.target"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services."autoballoon" = {
|
||||||
|
serviceConfig = {
|
||||||
|
StartLimitBurst = 100;
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
${pkgs.procps}/bin/free -m | grep Mem | \
|
||||||
|
${pkgs.gawk}/bin/awk '{print $2 "-" $4}' | \
|
||||||
|
${pkgs.bc}/bin/bc > /home/user/.memory_used
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.timers."autoballoon" = {
|
||||||
|
description = "Auto update resolution crutch";
|
||||||
|
timerConfig = {
|
||||||
|
OnBootSec = "1s";
|
||||||
|
OnUnitInactiveSec = "1s";
|
||||||
|
Unit = "autoballoon.service";
|
||||||
|
AccuracySec = "1us";
|
||||||
|
};
|
||||||
|
wantedBy = ["timers.target"];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
|
Loading…
Reference in New Issue
Block a user