From fbd31d3b4318bea37c7f8a84ebb03373656dd65b Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 7 Feb 2024 11:37:41 -0600 Subject: [PATCH] fix(nix-hm): properly load icons, theme for gtk --- config/default.nix | 37 +++--- dots/.config/mimeapps.list | 47 -------- dots/.local/share/applications/mimeinfo.cache | 7 -- .../.local/share/applications/spotify.desktop | 11 -- .../userapp-Thunderbird-WD0391.desktop | 8 -- .../share/applications/wezterm-open.desktop | 12 -- flake.lock | 113 ++++++++++++++---- flake.nix | 13 +- pkgs/kanagawa-gtk/default.nix | 30 ----- pkgs/kanagawa-gtk/flake.lock | 78 ++++++++++++ pkgs/kanagawa-gtk/flake.nix | 88 ++++++++++++++ 11 files changed, 284 insertions(+), 160 deletions(-) delete mode 100644 dots/.config/mimeapps.list delete mode 100644 dots/.local/share/applications/mimeinfo.cache delete mode 100644 dots/.local/share/applications/spotify.desktop delete mode 100644 dots/.local/share/applications/userapp-Thunderbird-WD0391.desktop delete mode 100644 dots/.local/share/applications/wezterm-open.desktop delete mode 100644 pkgs/kanagawa-gtk/default.nix create mode 100644 pkgs/kanagawa-gtk/flake.lock create mode 100644 pkgs/kanagawa-gtk/flake.nix diff --git a/config/default.nix b/config/default.nix index e5504286..c237c5eb 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,4 +1,4 @@ -{ pkgs, config, inputs, ... }: +{ pkgs, config, inputs, lib, ... }: let dotsDir = "${config.home.homeDirectory}/.dot_files/dots"; softLinkDots = dir: @@ -91,9 +91,8 @@ in { ]; file = { - ".local/" = { - source = ../dots/.local; - recursive = true; + ".local/share/wallpapers" = { + source = ../dots/.local/share/wallpapers; force = true; }; ".omnisharp" = { @@ -105,19 +104,17 @@ in { force = true; }; } // softLinkDots ".config"; - - sessionVariables = { - GTK_THEME = "Kanagawa-Borderless"; - QT_QPA_PLATFORMTHEME = "${gtkStyle}"; - GTK_PATH = "${config.home.homeDirectory}/.nix-profile/lib/gtk-2.0"; - # LD_LIBRARY_PATH = "${config.home.homeDirectory}/.nix-profile/lib"; - # PKG_CONFIG_PATH = "${config.home.homeDirectory}/.nix-profile/lib/pkgconfig"; - }; }; xdg = { enable = true; mime.enable = true; + mimeApps.enable = true; + systemDirs.data = [ + "${config.home.homeDirectory}/.nix-profile/share" + "/usr/share" + "/usr/local/share" + ]; }; programs = { @@ -130,7 +127,6 @@ in { enable = true; initExtra = '' source "$HOME/.config/zsh/zsh" - export XDG_DATA_DIRS="$HOME/.nix-profile/share:$XDG_DATA_DIRS" __HM_SESS_VARS_SOURCED= source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ''; }; @@ -160,12 +156,12 @@ in { in { enable = true; theme = { - name = "Kanagawa-Borderless"; + name = "Kanagawa-BL"; package = pkgs.kanagawa-gtk-theme; }; iconTheme = { name = "Kanagawa"; - package = pkgs.kanagawa-gtk-theme; + package = pkgs.kanagawa-gtk-icon-theme; }; font = { name = "Open Sans"; @@ -183,16 +179,19 @@ in { }; systemd.user = { - sessionVariables = config.home.sessionVariables; targets.compositor = { Unit = { Description = "Unit for DE to launch"; - ConditionEnvironment = [ "WAYLAND_DISPLAY" "DISPLAY" ]; + ConditionEnvironment = + [ "WAYLAND_DISPLAY" "DISPLAY" ]; }; }; services = { waybar = { - Service.Environment="GTK_THEME='THIS THEME DOES NOT EXIST!'"; + Service.Environment = [ + "GTK_THEME='THIS THEME DOES NOT EXIST!'" + ]; + Service.ExecStartPre = "env"; Install.WantedBy = [ "compositor.target" ]; Unit = { PartOf = [ "compositor.target" ]; @@ -203,7 +202,7 @@ in { Install.WantedBy = [ "compositor.target" ]; Unit = { PartOf = [ "compositor.target" ]; - After = [ "compositor.target" ]; + After = [ "compositor.target" "waybar.service" ]; }; }; easyeffects = { diff --git a/dots/.config/mimeapps.list b/dots/.config/mimeapps.list deleted file mode 100644 index c1c6852b..00000000 --- a/dots/.config/mimeapps.list +++ /dev/null @@ -1,47 +0,0 @@ -# vim: set ft=systemd: -[Default Applications] -x-scheme-handler/http=firefoxdeveloperedition.desktop -x-scheme-handler/https=firefoxdeveloperedition.desktop -x-scheme-handler/chrome=firefoxdeveloperedition.desktop -text/html=firefoxdeveloperedition.desktop -application/x-extension-htm=firefoxdeveloperedition.desktop -application/x-extension-html=firefoxdeveloperedition.desktop -application/x-extension-shtml=firefoxdeveloperedition.desktop -application/xhtml+xml=firefoxdeveloperedition.desktop -application/x-extension-xhtml=firefoxdeveloperedition.desktop -application/x-extension-xht=firefoxdeveloperedition.desktop -node/directory=wezterm-open.desktop -inode/directory=wezterm-open.desktop -text/*=wezterm-open.desktop -application/x-sh=wezterm-open.desktop -application/x-shellscript=wezterm-open.desktop -x-scheme-handler/ssh=wezterm-open.desktop -x-scheme-handler/mailto=userapp-Thunderbird-WD0391.desktop -message/rfc822=userapp-Thunderbird-WD0391.desktop -x-scheme-handler/mid=userapp-Thunderbird-WD0391.desktop -application/pdf=org.pwmt.zathura.desktop -image/gif=mpv.desktop -image/png=feh.desktop -image=feh.desktop -image/vnd.djvu=org.pwmt.zathura.desktop - -[Added Associations] -x-scheme-handler/http=firefoxdeveloperedition.desktop; -x-scheme-handler/https=firefoxdeveloperedition.desktop; -x-scheme-handler/chrome=firefoxdeveloperedition.desktop; -text/html=firefoxdeveloperedition.desktop; -application/x-extension-htm=firefoxdeveloperedition.desktop; -application/x-extension-html=firefoxdeveloperedition.desktop; -application/x-extension-shtml=firefoxdeveloperedition.desktop; -application/xhtml+xml=firefoxdeveloperedition.desktop; -application/x-extension-xhtml=firefoxdeveloperedition.desktop; -application/x-extension-xht=firefoxdeveloperedition.desktop; -node/directory=wezterm-open.desktop; -inode/directory=wezterm-open.desktop; -text/*=wezterm-open.desktop; -application/x-sh=wezterm-open.desktop; -application/x-shellscript=wezterm-open.desktop; -x-scheme-handler/ssh=wezterm-open.desktop; -image/*=wezterm-open.desktop; -x-scheme-handler/mailto=userapp-Thunderbird-WD0391.desktop; -x-scheme-handler/mid=userapp-Thunderbird-WD0391.desktop; diff --git a/dots/.local/share/applications/mimeinfo.cache b/dots/.local/share/applications/mimeinfo.cache deleted file mode 100644 index 7cd60309..00000000 --- a/dots/.local/share/applications/mimeinfo.cache +++ /dev/null @@ -1,7 +0,0 @@ -[MIME Cache] -application/x-sh=wezterm-open.desktop; -application/x-shellscript=wezterm-open.desktop; -image/*=wezterm-open.desktop; -inode/directory=wezterm-open.desktop; -text/*=wezterm-open.desktop; -x-scheme-handler/ssh=wezterm-open.desktop; diff --git a/dots/.local/share/applications/spotify.desktop b/dots/.local/share/applications/spotify.desktop deleted file mode 100644 index 16e6e713..00000000 --- a/dots/.local/share/applications/spotify.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Spotify -GenericName=Music Player -Icon=spotify-client -TryExec=spotify -Exec=spotify --uri=%U --disable-gpu -Terminal=false -MimeType=x-scheme-handler/spotify; -Categories=Audio;Music;Player;AudioVideo; -StartupWMClass=spotify diff --git a/dots/.local/share/applications/userapp-Thunderbird-WD0391.desktop b/dots/.local/share/applications/userapp-Thunderbird-WD0391.desktop deleted file mode 100644 index dddaf2ea..00000000 --- a/dots/.local/share/applications/userapp-Thunderbird-WD0391.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -NoDisplay=true -Exec=/usr/lib/thunderbird/thunderbird %u -Name=Thunderbird -Comment=Custom definition for Thunderbird diff --git a/dots/.local/share/applications/wezterm-open.desktop b/dots/.local/share/applications/wezterm-open.desktop deleted file mode 100644 index 9946b0ad..00000000 --- a/dots/.local/share/applications/wezterm-open.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Name=WezTerm -Comment=Wez's Terminal Emulator -Keywords=shell;prompt;command;commandline;cmd; -Icon=org.wezfurlong.wezterm -StartupWMClass=org.wezfurlong.wezterm -TryExec=wezterm -Exec=wezterm start --cwd %U -Type=Application -Categories=System;TerminalEmulator;Utility; -Terminal=false -MimeType=image/*;application/x-sh;application/x-shellscript;inode/directory;text/*;x-scheme-handler/ssh; diff --git a/flake.lock b/flake.lock index 487091be..438401d1 100644 --- a/flake.lock +++ b/flake.lock @@ -78,11 +78,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1707099004, - "narHash": "sha256-O5LZdwF6QL6Vt8RVnmtiYIt0ZD/vhwnHf2k4sHG8xog=", + "lastModified": 1707239087, + "narHash": "sha256-T7wEhA+1O4nC77S7JRulrWuGy5q1m6aqu2bZ8E+2SqU=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "b7c67b5f71db89ec27e1aa4413fbbcdf5bbfa451", + "rev": "bda20050fde1908491e9b573430ebc4745cdea58", "type": "github" }, "original": { @@ -207,6 +207,24 @@ "inputs": { "systems": "systems_4" }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "inputs": { + "systems": "systems_5" + }, "locked": { "lastModified": 1701680307, "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", @@ -221,9 +239,9 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_6": { "inputs": { - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1705309234, @@ -302,11 +320,11 @@ ] }, "locked": { - "lastModified": 1707088232, - "narHash": "sha256-nxPBAZ//BwKkBcjwLE5g9zTq29g7gccTnH5+CeMTxpA=", + "lastModified": 1707175763, + "narHash": "sha256-0MKHC6tQ4KEuM5rui6DjKZ/VNiSANB4E+DJ/+wPS1PU=", "owner": "nix-community", "repo": "home-manager", - "rev": "4740f2ccda184e9cc509d7a82b26d7271e0c79d9", + "rev": "f99eace7c167b8a6a0871849493b1c613d0f1b80", "type": "github" }, "original": { @@ -315,6 +333,41 @@ "type": "github" } }, + "kanagawa-gtk": { + "inputs": { + "flake-utils": "flake-utils_4", + "kanagawa-gtk": "kanagawa-gtk_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-XOfyIaOV3z2bcuMbFz4MFlOLoFQvlmX8rwPQCl4+PII=", + "path": "./pkgs/kanagawa-gtk", + "type": "path" + }, + "original": { + "path": "./pkgs/kanagawa-gtk", + "type": "path" + } + }, + "kanagawa-gtk_2": { + "flake": false, + "locked": { + "lastModified": 1688426096, + "narHash": "sha256-BZRmjVas8q6zsYbXFk4bCk5Ec/3liy9PQ8fqFGHAXe0=", + "owner": "Fausto-Korpsvart", + "repo": "Kanagawa-GKT-Theme", + "rev": "35936a1e3bbd329339991b29725fc1f67f192c1e", + "type": "github" + }, + "original": { + "owner": "Fausto-Korpsvart", + "repo": "Kanagawa-GKT-Theme", + "type": "github" + } + }, "libpng": { "flake": false, "locked": { @@ -334,7 +387,7 @@ }, "neovim-flake": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": [ "neovim-nightly-overlay", "nixpkgs" @@ -380,11 +433,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1706913249, - "narHash": "sha256-x3M7iV++CsvRXI1fpyFPduGELUckZEhSv0XWnUopAG8=", + "lastModified": 1707092692, + "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e92b6015881907e698782c77641aa49298330223", + "rev": "faf912b086576fd1a15fca610166c98d47bc667e", "type": "github" }, "original": { @@ -396,11 +449,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1706826059, - "narHash": "sha256-N69Oab+cbt3flLvYv8fYnEHlBsWwdKciNZHUbynVEOA=", + "lastModified": 1707091808, + "narHash": "sha256-LahKBAfGbY836gtpVNnWwBTIzN7yf/uYM/S0g393r0Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "25e3d4c0d3591c99929b1ec07883177f6ea70c9d", + "rev": "9f2ee8c91ac42da3ae6c6a1d21555f283458247e", "type": "github" }, "original": { @@ -428,11 +481,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1706925685, - "narHash": "sha256-hVInjWMmgH4yZgA4ZtbgJM1qEAel72SYhP5nOWX4UIM=", + "lastModified": 1707171055, + "narHash": "sha256-7ZiKRdhrScsDfhDkGy8yJWAT6BfHqa8PYMX04roU03k=", "owner": "nixos", "repo": "nixpkgs", - "rev": "79a13f1437e149dc7be2d1290c74d378dad60814", + "rev": "4b1aab22192b787355733c9495d47f4c66af084c", "type": "github" }, "original": { @@ -448,6 +501,7 @@ "deepfilternet": "deepfilternet", "emacs-overlay": "emacs-overlay", "home-manager": "home-manager", + "kanagawa-gtk": "kanagawa-gtk", "neovim-nightly-overlay": "neovim-nightly-overlay", "nixpkgs": "nixpkgs_3", "wezterm": "wezterm" @@ -553,9 +607,24 @@ "type": "github" } }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "wezterm": { "inputs": { - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "freetype2": "freetype2", "harfbuzz": "harfbuzz", "libpng": "libpng", @@ -567,11 +636,11 @@ }, "locked": { "dir": "nix", - "lastModified": 1707064947, - "narHash": "sha256-m76FLPey25grg+KmL2u9S0TEyDBQxvALYkKnqGQHO7k=", + "lastModified": 1707241449, + "narHash": "sha256-u/BQHcZ/v4Cz2LR+/r9DjRDEcF9Om5dNQ9g+/j6lD5c=", "owner": "wez", "repo": "wezterm", - "rev": "bed5141d6e07f2e82ad68cb73feb7b7949460aad", + "rev": "5d190c2b7a11203139fd58c2fcd57f34cf5fd301", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bdd29ad2..11828593 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,10 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + kanagawa-gtk = { + url = "path:./pkgs/kanagawa-gtk"; + inputs.nixpkgs.follows = "nixpkgs"; + }; bob = { url = "path:./pkgs/bob-nvim"; inputs.nixpkgs.follows = "nixpkgs"; @@ -30,7 +34,9 @@ lib = nixpkgs.lib; in { defaultPackage.x86_64-linux = home-manager.defaultPackage.x86_64-linux; - targets.genericLinux.enable = true; + targets.genericLinux = { + enable = true; + }; homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration rec { pkgs = nixpkgs.legacyPackages.${system}; @@ -42,9 +48,8 @@ inputs.emacs-overlay.overlays.emacs inputs.bob.overlays.default inputs.deepfilternet.overlays.default - (final: prev: - { - kanagawa-gtk-theme = prev.callPackage ./pkgs/kanagawa-gtk { }; + inputs.kanagawa-gtk.overlays.default + (final: prev: { lxappearance = prev.lxappearance.overrideAttrs (oldAttrs: { postInstall = '' wrapProgram $out/bin/lxappearance --prefix GDK_BACKEND : x11 diff --git a/pkgs/kanagawa-gtk/default.nix b/pkgs/kanagawa-gtk/default.nix deleted file mode 100644 index f93e1f57..00000000 --- a/pkgs/kanagawa-gtk/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ lib, stdenvNoCC, fetchFromGitHub, gnome-themes-extra, gtk-engine-murrine }: - -stdenvNoCC.mkDerivation { - pname = "kanagawa-gtk-theme"; - version = "unstable-2023-11-30"; - - src = fetchFromGitHub { - owner = "Fausto-Korpsvart"; - repo = "Kanagawa-GKT-Theme"; - rev = "35936a1e3bbd329339991b29725fc1f67f192c1e"; - hash = "sha256-BZRmjVas8q6zsYbXFk4bCk5Ec/3liy9PQ8fqFGHAXe0="; - }; - - propagatedUserEnvPkgs = [ gtk-engine-murrine ]; - - buildInputs = [ gnome-themes-extra ]; - - dontBuild = true; - - installPhase = '' - runHook preInstall - mkdir -p $out/share/themes/{Kanagawa-Border,Kanagawa-Borderless} - mkdir -p $out/share/icons - sed -e 's/oomox-//' -i icons/*/index.theme - cp -r icons/Kanagawa $out/share/icons - cp -r themes/Kanagawa-B/* $out/share/themes/Kanagawa-Border - cp -r themes/Kanagawa-BL/* $out/share/themes/Kanagawa-Borderless - runHook postInstall - ''; -} diff --git a/pkgs/kanagawa-gtk/flake.lock b/pkgs/kanagawa-gtk/flake.lock new file mode 100644 index 00000000..33a95c79 --- /dev/null +++ b/pkgs/kanagawa-gtk/flake.lock @@ -0,0 +1,78 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "kanagawa-gtk": { + "flake": false, + "locked": { + "lastModified": 1688426096, + "narHash": "sha256-BZRmjVas8q6zsYbXFk4bCk5Ec/3liy9PQ8fqFGHAXe0=", + "owner": "Fausto-Korpsvart", + "repo": "Kanagawa-GKT-Theme", + "rev": "35936a1e3bbd329339991b29725fc1f67f192c1e", + "type": "github" + }, + "original": { + "owner": "Fausto-Korpsvart", + "repo": "Kanagawa-GKT-Theme", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1707171055, + "narHash": "sha256-7ZiKRdhrScsDfhDkGy8yJWAT6BfHqa8PYMX04roU03k=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "4b1aab22192b787355733c9495d47f4c66af084c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "kanagawa-gtk": "kanagawa-gtk", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/kanagawa-gtk/flake.nix b/pkgs/kanagawa-gtk/flake.nix new file mode 100644 index 00000000..e4cc29ec --- /dev/null +++ b/pkgs/kanagawa-gtk/flake.nix @@ -0,0 +1,88 @@ +{ + description = "Flake for the Kanagwa GTK Theme"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + kanagawa-gtk = { + flake = false; + url = "github:Fausto-Korpsvart/Kanagawa-GKT-Theme"; + }; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils, kanagawa-gtk }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + lib = nixpkgs.lib; + in rec { + # This builds the blog binary then runs it and collects the output. Once done it throws away the binary and + # shoves the newly created static site into the result. + packages.kanagawa-gtk-theme = pkgs.stdenvNoCC.mkDerivation rec { + pname = "kanagawa-gtk-theme"; + version = "unknown"; + + src = "${kanagawa-gtk}"; + + propagatedUserEnvPkgs = with pkgs; [ gtk-engine-murrine ]; + + nativeBuildInputs = with pkgs; [ gtk3 ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/themes + cp -a themes/* $out/share/themes + runHook postInstall + ''; + meta = with lib; { + description = + "A GTK theme with the Kanagawa colour palette. Borrowed with ❤️ from https://github.com/NixOS/nixpkgs/pull/277073."; + homepage = "https://github.com/Fausto-Korpsvart/Kanagawa-GKT-Theme"; + license = licenses.gpl3Only; + platforms = platforms.all; + }; + + }; + packages.default = packages.kanagawa-gtk-theme; + + packages.kanagwa-icon-theme = pkgs.stdenvNoCC.mkDerivation rec { + pname = "kanagawa-icon-theme"; + version = "unknown"; + + src = "${kanagawa-gtk}"; + + nativeBuildInputs = with pkgs; [ gtk3 ]; + + propagatedBuildInputs = with pkgs; [ hicolor-icon-theme ]; + + dontDropIconThemeCache = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/icons + cp -a icons/* $out/share/icons + for theme in $out/share/icons/*; do + gtk-update-icon-cache -f $theme + done + + runHook postInstall + ''; + + meta = with lib; { + description = + "An icon theme for the Kanagawa colour palette. Borrowed with ❤️ from https://github.com/NixOS/nixpkgs/pull/277073."; + homepage = "https://github.com/Fausto-Korpsvart/Kanagawa-GKT-Theme"; + license = licenses.gpl3Only; + platforms = platforms.all; + }; + }; + + # Rust dev environment + }) // { + overlays.default = final: prev: { + kanagawa-gtk-theme = self.packages.${final.system}.kanagawa-gtk-theme; + kanagawa-gtk-icon-theme = self.packages.${final.system}.kanagwa-icon-theme; + }; + }; +}