Fix string warning, script execution
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m51s

This commit is contained in:
2025-10-25 22:16:38 +02:00
committed by ahtlon
parent 8d5702d93a
commit 6cabd45e1c

View File

@@ -4,10 +4,10 @@
enable = lib.mkOption { enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;
description = "Enable the script to pull data from the printer" description = "Enable the script to pull data from the printer";
}; };
timer = lib.mkOption { timer = lib.mkOption {
type = lib.types.string; type = lib.types.str;
default = "1m"; default = "1m";
description = "systemd timer for script execution"; description = "systemd timer for script execution";
}; };
@@ -17,13 +17,13 @@
systemd.services."printer-scraping" = { systemd.services."printer-scraping" = {
description = "Pull printer stats and upload to influxdb"; description = "Pull printer stats and upload to influxdb";
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
path = with pkgs; [yq curl]; path = with pkgs; [yq jq curl bash];
script = "exec ${./pull_info.sh}"; script = "bash ${./pull_info.sh}";
}; };
systemd.timers."printer-scraping" = { systemd.timers."printer-scraping" = {
wantedBy = ["timers.target"]; wantedBy = ["timers.target"];
timerConfig = { timerConfig = {
OnBootSec = "60s"; OnBootSec = "5s";
OnUnitActiveSec = config.printer_scraping.timer; OnUnitActiveSec = config.printer_scraping.timer;
Unit = "printer-scraping.service"; Unit = "printer-scraping.service";
}; };