1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-18 15:39:46 +03:00
nixpkgs/nixos/modules/services/misc/sundtek.nix

36 lines
711 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
2015-07-02 03:18:56 +02:00
let
cfg = config.services.sundtek;
in
{
options.services.sundtek = {
enable = lib.mkEnableOption "Sundtek driver";
2015-07-02 03:18:56 +02:00
};
config = lib.mkIf cfg.enable {
2015-07-02 03:18:56 +02:00
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 ;\
${pkgs.sundtek}/bin/mediaclient --start --wait-for-devices
'';
2015-07-02 03:18:56 +02:00
ExecStop = "${pkgs.sundtek}/bin/mediaclient --shutdown";
RemainAfterExit = true;
};
};
};
}