services.hpcstat: fix

This commit is contained in:
陈浩南 2024-06-07 01:20:35 +08:00
parent eb4cac0f14
commit 77296face8

View File

@ -82,18 +82,26 @@ inputs:
in in
{ {
services = builtins.listToAttrs (builtins.map services = builtins.listToAttrs (builtins.map
(script: { "hpcstat-${script.name}" = (script:
{
name = "hpcstat-${script.name}";
value =
{ {
script = script.value; script = script.value;
serviceConfig = { Type = "oneshot"; User = "hpcstat"; Group = "hpcstat"; }; serviceConfig = { Type = "oneshot"; User = "hpcstat"; Group = "hpcstat"; };
};}) };
})
(inputs.localLib.attrsToList scripts)); (inputs.localLib.attrsToList scripts));
timers = builtins.listToAttrs (builtins.map timers = builtins.listToAttrs (builtins.map
(calender: { "hpcstat-${calender.name}" = (calender:
{
name = "hpcstat-${calender.name}";
value =
{ {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig = { OnCalendar = calender.value; Unit = "hpcstat-${calender.name}.service"; }; timerConfig = { OnCalendar = calender.value; Unit = "hpcstat-${calender.name}.service"; };
};}) };
})
(inputs.localLib.attrsToList calenders)); (inputs.localLib.attrsToList calenders));
tmpfiles.rules = [ "d /var/lib/hpcstat 0700 hpcstat hpcstat" ]; tmpfiles.rules = [ "d /var/lib/hpcstat 0700 hpcstat hpcstat" ];
}; };