9 cfg = config.programs.qgroundcontrol;
14 programs.qgroundcontrol = {
15 enable = lib.mkEnableOption "qgroundcontrol";
17 package = lib.mkPackageOption pkgs "qgroundcontrol" {};
19 blacklistModemManagerFromTTYUSB = lib.mkOption {
20 type = lib.types.bool;
23 Disallow ModemManager from interfering with serial connections that QGroundControl might use.
25 Note that if you use a modem that's connected via USB, you might want to disable this option.
31 config = lib.mkIf cfg.enable {
32 # ModemManager is known to interfere with serial connections;
33 # QGC recommends disabling it, but we don't want to if we can avoid it
34 # Instead, we blacklist tty devices using udev rules, which is a more targeted approach
35 services.udev = lib.mkIf cfg.blacklistModemManagerFromTTYUSB {
38 # nixos/qgroundcontrol: Blacklist ttyUSB devices from ModemManager
39 SUBSYSTEM=="tty", KERNEL=="ttyUSB*", ENV{ID_MM_DEVICE_IGNORE}="1"
44 security.wrappers.qgroundcontrol = {
45 source = lib.getExe cfg.package;
46 owner = "root"; # Sensible default; not setuid so this is not a security risk
52 meta.maintainers = pkgs.qgroundcontrol.meta.maintainers;