{ lib, pkgs, config, ... }: let cfg = config.services.nqptp; in { options.services.nqptp = { enable = lib.mkEnableOption "nqptp service for shairport-sync"; }; config = lib.mkIf cfg.enable { systemd.services.nqptp = { description = "Network Queued PCM Transport Protocol"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "simple"; ExecStart = lib.getExe pkgs.nqptp; Restart = "on-failure"; }; }; }; }