{ config, lib, pkgs, ... }:

let cfg = config.sydnix.ios;
in {
  options.sydnix.ios = {
    enable = lib.mkEnableOption "interaction with iOS devices over USB";
  };

  config = lib.mkIf cfg.enable {
    # Required for libimobiledevice, seemingly.
    services.usbmuxd.enable = true;

    environment.systemPackages = [
      pkgs.ifuse
      pkgs.libimobiledevice
    ];
  };
}
