{ lib, config, pkgs, ... }:
with lib;
let
  cfg = config.modules.application.imv;
in
{
  options.modules.application.imv = {
    enable = mkEnableOption "enable IMV image viewer";

    installPackage = mkOption {
      type = types.bool;
      default = true;
      description = "install Package, if false relies on distribution packages";
    };

  };
  config = mkIf cfg.enable {
    programs.imv = {
      enable = true;
    };
    xdg.mimeApps.defaultApplications = {
        "image/*" = "imv-dir.desktop";
    };
  };
}
