{ pkgs, config, lib, ... }: with lib; let cfg = config.services.akkoma.emoji; in { options.services.akkoma.emoji = { enable = mkEnableOption "Akkoma Emoji"; emojiPackages = mkOption { type = with types; listOf package; default = []; description = '' List of packages to install into Akkoma's emoji store. Each entry will be its own category in the emoji picker. These can be _any_ package/derivation, Akkoma is expecting .png and .gif files, though. ''; }; }; config = mkIf cfg.enable { services.akkoma = { config.":pleroma".":emoji" = with (pkgs.formats.elixirConf { }).lib; { # shortcode_globs = ["/emoji/**/*.png" "/emoji/**/*.gif"]; groups = mkMap(builtins.listToAttrs( map (package: { name = package.name; value = "/emoji/${package.name}/*"; }) cfg.emojiPackages )); }; extraStatic = builtins.listToAttrs( map (package: { name = "emoji/${package.name}"; value = package; }) cfg.emojiPackages ); }; }; }