Skip to content

Instantly share code, notes, and snippets.

@phdoerfler
Created June 24, 2019 11:06
Show Gist options
  • Save phdoerfler/c22a06ef642ee7fe815ec271f1214565 to your computer and use it in GitHub Desktop.
Save phdoerfler/c22a06ef642ee7fe815ec271f1214565 to your computer and use it in GitHub Desktop.
NixOS systemd service with python
{ 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