-
-
Save CMCDragonkai/8141efeefc1f5961d5b60e3aa2d886df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, ... }: | |
with lib; | |
let | |
cfg = config.services.image-classifier; | |
script = ./test.py; | |
in | |
{ | |
options.services.image-classifier.scheduler = { | |
enable = mkEnableOption "test"; | |
}; | |
config = lib.mkIf cfg.enable { | |
systemd.services.hello = { | |
after = [ "network-online.target" ]; | |
wants = [ "network-online.target" ]; | |
wantedBy = [ "multi-user.target" ]; | |
serviceConfig = { | |
RuntimeDirectory = "helloworld"; | |
ExecStart = "${pkgs.python3}/bin/python -u ${script} $RUNTIME_DIRECTORY"; | |
}; | |
}; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import time | |
while True: | |
time.sleep(1) | |
print(sys.argv) | |
print("Hello World") | |
print(os.getcwd()) | |
#print(os.listdir()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment