22 lines
613 B
Nix
22 lines
613 B
Nix
|
{ self, config, pkgs, lib, ... }:
|
||
|
let
|
||
|
cfg = config.services.thekenlicht-daemon;
|
||
|
in
|
||
|
{
|
||
|
options = {
|
||
|
services.thekenlicht-daemon = {
|
||
|
enable = lib.mkEnableOption "Enable Module";
|
||
|
serialPort = lib.mkStringOption "Serial Port";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = lib.mkIf cfg.enable {
|
||
|
systemd.services.thekenlicht-daemon = {
|
||
|
description = "converts artnet to serial thekenlicht commands";
|
||
|
wantedBy = [ "multi-user.target" ];
|
||
|
serviceConfig.ExecStart = "${self.packages.thekenlicht-daemon}/bin/thekenlicht-daemon ${cfg.serialPort}";
|
||
|
serviceConfig.Restart = "on-failure";
|
||
|
};
|
||
|
};
|
||
|
}
|