2015-07-02 03:18:56 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.sundtek;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.services.sundtek = {
|
2024-04-13 14:54:15 +02:00
|
|
|
enable = mkEnableOption "Sundtek driver";
|
2015-07-02 03:18:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.sundtek ];
|
|
|
|
|
|
|
|
systemd.services.sundtek = {
|
|
|
|
description = "Sundtek driver";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = ''
|
|
|
|
${pkgs.sundtek}/bin/mediasrv -d -v -p ${pkgs.sundtek}/bin ;\
|
2016-01-30 20:08:52 +01:00
|
|
|
${pkgs.sundtek}/bin/mediaclient --start --wait-for-devices
|
2015-07-02 03:18:56 +02:00
|
|
|
'';
|
|
|
|
ExecStop = "${pkgs.sundtek}/bin/mediaclient --shutdown";
|
|
|
|
RemainAfterExit = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|