Created
June 24, 2019 11:06
-
-
Save phdoerfler/c22a06ef642ee7fe815ec271f1214565 to your computer and use it in GitHub Desktop.
NixOS systemd service with python
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, pkgs, lib, ... }: | |
let | |
python = pkgs.python3Packages.python; | |
in | |
{ | |
systemd.services.thermonitor = { | |
description = "Thermonitor Daemon"; | |
serviceConfig = { | |
ExecStart = "/home/phi/thermonitor.py"; | |
Restart = "on-failure"; | |
}; | |
wantedBy = [ "multi-user.target" ]; | |
after = [ "network.target" ]; | |
environment.systemPackages = [ python ]; | |
}; | |
systemd.services.thermonitor.enable = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment