mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 02:03:01 +00:00
0a37316d6c
This commit replaces a lot of usages of `mkOption` with the package type, to be `mkPackageOption`, in order to reduce the amount of code.
34 lines
806 B
Nix
34 lines
806 B
Nix
{ config, lib, pkgs, ... }:
|
|
let
|
|
cfg = config.services.openwebrx;
|
|
in
|
|
{
|
|
options.services.openwebrx = with lib; {
|
|
enable = mkEnableOption (lib.mdDoc "OpenWebRX Web interface for Software-Defined Radios on http://localhost:8073");
|
|
|
|
package = mkPackageOption pkgs "openwebrx" { };
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
systemd.services.openwebrx = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
path = with pkgs; [
|
|
csdr
|
|
digiham
|
|
codec2
|
|
js8call
|
|
m17-cxx-demod
|
|
alsaUtils
|
|
netcat
|
|
];
|
|
serviceConfig = {
|
|
ExecStart = "${cfg.package}/bin/openwebrx";
|
|
Restart = "always";
|
|
DynamicUser = true;
|
|
# openwebrx uses /var/lib/openwebrx by default
|
|
StateDirectory = [ "openwebrx" ];
|
|
};
|
|
};
|
|
};
|
|
}
|