2021-11-09 21:54:12 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.services.openwebrx;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.services.openwebrx = with lib; {
|
2022-08-28 20:18:44 +01:00
|
|
|
enable = mkEnableOption (lib.mdDoc "OpenWebRX Web interface for Software-Defined Radios on http://localhost:8073");
|
2021-11-09 21:54:12 +00:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.openwebrx;
|
2021-11-26 00:16:05 +00:00
|
|
|
defaultText = literalExpression "pkgs.openwebrx";
|
2022-07-28 22:19:15 +01:00
|
|
|
description = lib.mdDoc "OpenWebRX package to use for the service";
|
2021-11-09 21:54:12 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
systemd.services.openwebrx = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
path = with pkgs; [
|
|
|
|
csdr
|
2021-12-14 20:57:51 +00:00
|
|
|
digiham
|
2022-07-03 18:53:06 +01:00
|
|
|
codec2
|
|
|
|
js8call
|
2022-07-03 19:10:03 +01:00
|
|
|
m17-cxx-demod
|
2021-11-09 21:54:12 +00:00
|
|
|
alsaUtils
|
|
|
|
netcat
|
|
|
|
];
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${cfg.package}/bin/openwebrx";
|
|
|
|
Restart = "always";
|
|
|
|
DynamicUser = true;
|
|
|
|
# openwebrx uses /var/lib/openwebrx by default
|
|
|
|
StateDirectory = [ "openwebrx" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|