{ lib, flake-parts-lib, ... }: let inherit (lib) mkOption mkEnableOption types; inherit (flake-parts-lib) mkPerSystemOption; in { options.perSystem = mkPerSystemOption ({ pkgs, system, config, ... }: { options.koreader = mkOption { default = {}; type = types.lazyAttrsOf <| types.submoduleWith { shorthandOnlyDefinesConfig = true; modules = [ { _module.args = { inherit pkgs lib; }; } ({ name, ... }: { imports = [ ./main.nix ]; options = { enable = mkEnableOption name // { default = true; }; }; }) ]; }; }; }); }