zaphyra's git: tgcNUR

fork of https://git.transgirl.cafe/zaphoid/tgc-nix-user-repository

commit 76b9f59feb8c7d0b2b95179e9135e9e77218634d
parent c688e9d72a8f949c3f3a415c8ef3487b32283074
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Fri, 22 Aug 2025 13:48:19 +0200

packages: add `adwaita-colors-icon-theme`
1 file changed, 70 insertions(+), 0 deletions(-)
A
packages/adwaita-colors-icon-theme/package.nix
|
70
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/packages/adwaita-colors-icon-theme/package.nix b/packages/adwaita-colors-icon-theme/package.nix
@@ -0,0 +1,70 @@
+{
+  tgcMaintainers,
+  lib,
+  stdenvNoCC,
+  fetchFromGitHub,
+  gtk3,
+  hicolor-icon-theme,
+  adwaita-icon-theme,
+  ...
+}:
+
+stdenvNoCC.mkDerivation (finalAttrs: {
+  pname = "adwaita-colors-icon-theme";
+  version = "2.4.1";
+  rev = "v${finalAttrs.version}";
+  srcHash = "sha256-M5dFb759sXfpD9/gQVF3sngyW4WdSgy4usInds9VIWk=";
+
+  src = fetchFromGitHub {
+    owner = "dpejoh";
+    repo = "Adwaita-colors";
+    hash = finalAttrs.srcHash;
+    inherit (finalAttrs) rev;
+  };
+
+  nativeBuildInputs = [
+    gtk3
+  ];
+
+  propagatedBuildInputs = [
+    hicolor-icon-theme
+    adwaita-icon-theme
+  ];
+
+  patchPhase = ''
+    # for some reason there are fucking broken symlinks?!
+    rm ./Adwaita-blue/scalable/places/com.bitwig.BitwigStudio.application-bitwig-project-folder-legacy.svg
+
+    find ./ -type d -name "Adwaita-*" | while read -r dir; do
+      # Construct the full path to the "index.theme" file
+      file="$dir/index.theme"
+      # Check if the file exists and contains the target text
+      if [ -f "$file" ]; then
+        substituteInPlace $file \
+          --replace-fail "Hidden=true" "" \
+          --replace-fail "AdwaitaLegacy," ""
+      fi
+    done
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -d $out/share/icons
+    cp -r Adwaita-* $out/share/icons/
+
+    gtk-update-icon-cache -f -t $out/share/icons/Adwaita*
+
+    runHook postInstall
+  '';
+
+  dontDropIconThemeCache = true;
+
+  meta = {
+    description = "Adwaita Colors customizes Adwaita icons to match your GNOME theme's accent color, providing a cohesive, personalized look.";
+    homepage = "https://github.com/dpejoh/Adwaita-colors";
+    license = with lib.licenses; [ gpl3Only ];
+    platforms = lib.platforms.linux;
+    maintainers = [ tgcMaintainers.zaphyra ];
+  };
+})