From b8c7081df49e7ab8e9589f2ace6cceb4543175a7 Mon Sep 17 00:00:00 2001 From: emily Date: Tue, 19 Nov 2024 21:37:58 +0100 Subject: [PATCH] akkoma: add more emojis --- config/services/akkoma/default.nix | 90 ++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 22 deletions(-) diff --git a/config/services/akkoma/default.nix b/config/services/akkoma/default.nix index e3fec5a..09da839 100644 --- a/config/services/akkoma/default.nix +++ b/config/services/akkoma/default.nix @@ -22,33 +22,65 @@ }; in with pkgs; [ exiftool ffmpeg-headless imagemagick ]; - extraStatic."emoji/blobs.gg" = pkgs.akkoma-emoji.blobs_gg; + extraStatic = let + actualFetchzip = + { + url, + hash + }: pkgs.runCommandNoCC "${lib.last (lib.splitString "/" url)}" { + src = pkgs.fetchurl { + inherit url hash; + }; + } '' + ${lib.getExe pkgs.unzip} $src -d $out + for f in $out/*_256.png; do + mv -- "$f" "''${f/_256}" + done + ''; + in { + "emoji/blobs.gg" = pkgs.akkoma-emoji.blobs_gg; - extraStatic."emoji/florp" = pkgs.runCommandNoCC "florp" { - src = inputs.florp-branding.packages.${config.nixpkgs.hostPlatform.system}.favicon; - } '' - mkdir $out - cp $src $out/florp.png - ''; + "emoji/custom" = pkgs.runCommandNoCC "florp" { + src = inputs.florp-branding.packages.${config.nixpkgs.hostPlatform.system}.favicon; + } '' + mkdir $out + cp $src $out/florp.png + ''; - extraStatic."static/styles.json" = pkgs.writeText "styles.json" (builtins.toJSON ( - builtins.fromJSON (builtins.readFile "${pkgs.akkoma-fe-domi}/static/styles.json") // { - elly-mod = "/static/themes/elly-mod.json"; - } - )); + "emoji/neodog" = actualFetchzip { + url = "https://git.gay/moonrabbits/neodog/raw/commit/6f9eb283b6dcbe507fde1110abab267cb2d73b70/neodog.zip"; + hash = "sha256-ISyzpRyjHf+4jKrOtHHqH0Qn7CQu5RQSLH/HL/YSdT4="; + }; - extraStatic."static/themes/elly-mod.json" = pkgs.writeText "elly-mod.json" (builtins.readFile ./elly-mod.json); + "emoji/neocat" = actualFetchzip { + url = "https://volpeon.ink/emojis/neocat/neocat.zip"; + hash = "sha256-DZDuk0Djlax504flNWdpqAw+ROLOOVGj0ZvJLyouo7A="; + }; - extraStatic."static/custom.css" = pkgs.writeText "custom.css" '' - .tos-content img, .terms-of-service img { - max-width: 100%; - } - ''; + "emoji/neofox" = actualFetchzip { + url = "https://volpeon.ink/emojis/neofox/neofox.zip"; + hash = "sha256-rZUPA7ZvrO8q/lx8XK3IxJ1URLgq0PSh752eWzG+uos="; + }; - extraStatic."static/terms-of-service.html" = inputs.florp-about.packages.${pkgs.system}.default; - extraStatic."images/sylvia-ritter-15012323.avif" = inputs.florp-branding.packages.${pkgs.system}.wallpaper; - extraStatic."images/florp_banner.avif" = inputs.florp-branding.packages.${pkgs.system}.banner; - extraStatic."favicon.png" = inputs.florp-branding.packages.${pkgs.system}.favicon; + "static/styles.json" = pkgs.writeText "styles.json" (builtins.toJSON ( + builtins.fromJSON (builtins.readFile "${pkgs.akkoma-fe-domi}/static/styles.json") // { + elly-mod = "/static/themes/elly-mod.json"; + } + )); + + "static/themes/elly-mod.json" = pkgs.writeText "elly-mod.json" (builtins.readFile ./elly-mod.json); + + "static/custom.css" = pkgs.writeText "custom.css" '' + .tos-content img, .terms-of-service img { + max-width: 100%; + } + ''; + + "static/terms-of-service.html" = inputs.florp-about.packages.${pkgs.system}.default; + "images/sylvia-ritter-15012323.avif" = inputs.florp-branding.packages.${pkgs.system}.wallpaper; + "images/florp_banner.avif" = inputs.florp-branding.packages.${pkgs.system}.banner; + "favicon.png" = inputs.florp-branding.packages.${pkgs.system}.favicon; + }; frontends = { primary = { @@ -118,6 +150,20 @@ ]; }; + ":emoji".groups = { + blobs = "/emoji/blobs.gg/*.png"; + neodog = "/emoji/neodog/*.png"; + neocat = [ + "/emoji/neocat/*.png" + "/emoji/neodog/additional_neocat/*.png" + ]; + neofox = [ + "/emoji/neofox/*.png" + "/emoji/neodog/additional_neofox/*.png" + ]; + Custom = "/emoji/custom/*.png"; + }; + "Pleroma.Captcha".method = mkRaw "Pleroma.Captcha.Kocaptcha"; "Pleroma.Web.Endpoint".url.host = "florp.social";