From 6fbe022178bf1096bebdd7262c0a7b119317f219 Mon Sep 17 00:00:00 2001 From: Fiona Grzebien Date: Tue, 29 Oct 2024 18:48:14 +0100 Subject: [PATCH] Add Tangerine-UI to mastodon --- config/hosts/mastodon/mastodon.nix | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/config/hosts/mastodon/mastodon.nix b/config/hosts/mastodon/mastodon.nix index b895735..ed168ff 100644 --- a/config/hosts/mastodon/mastodon.nix +++ b/config/hosts/mastodon/mastodon.nix @@ -1,5 +1,10 @@ -{ pkgs, nixpkgs-unstable, ... }: +{ pkgs, ... }: let + tangerineUI = pkgs.fetchgit { + url = "https://github.com/nileane/TangerineUI-for-Mastodon.git"; + rev = "v2.2"; + hash = "sha256-KyXDnpZh1DrY59jvdU42UicgBVvEGtvAGeU1mNxJauQ="; + }; mastodonNekoversePatches = pkgs.fetchgit { url = "https://github.com/yuri-qq/nekoverse-mastodon-patches.git"; hash = "sha256-3jWbKll5RGB1vfEmONVivzGYcoONEkBEHh/rOt9LXlU="; @@ -8,10 +13,21 @@ let mastodon = (prev.mastodon.override rec { version = "4.3.1"; srcOverride = final.applyPatches { - src = final.fetchgit { - url = "https://github.com/mastodon/mastodon.git"; - rev = "v${version}"; - sha256 = "sha256-JlpQGyVPTLcB3RcWMBrmYc1AAUT1JLfS4IDas9ZoWh4="; + src = pkgs.stdenv.mkDerivation { + name = "mastodonWithThemes"; + src = pkgs.fetchgit { + url = "https://github.com/mastodon/mastodon.git"; + rev = "v${version}"; + sha256 = "sha256-JlpQGyVPTLcB3RcWMBrmYc1AAUT1JLfS4IDas9ZoWh4="; + }; + installPhase = '' + cp -r ./ $out/ + cp -r ${tangerineUI}/mastodon/app/javascript/styles/* $out/app/javascript/styles/ + echo "tangerineui: styles/tangerineui.scss + tangerineui-purple: styles/tangerineui-purple.scss + tangerineui-cherry: styles/tangerineui-cherry.scss + tangerineui-lagoon: styles/tangerineui-lagoon.scss" >> $out/config/themes.yml + ''; }; patches = [ "${mastodonNekoversePatches}/patches/001_increase_image_dimensions_limit.patch" @@ -25,7 +41,7 @@ let yarnHash = "sha256-e5c04M6XplAgaVyldU5HmYMYtY3MAWs+a8Z/BGSyGBg="; }); }; - pkgs-overlay = nixpkgs-unstable.legacyPackages."x86_64-linux".extend mastodonNekoverseOverlay; + pkgs-overlay = pkgs.extend mastodonNekoverseOverlay; vapidPublicKey = pkgs.writeText "vapid-public-key" "BDCbFEDCZ8eFuWr3uEq4Qc30UFZUQeNpF8OCw6OjPwAtaKS1yTM3Ue749Xjqy5WhBDjakzlixh4Gk7gluUhIdsU="; in {