From c8bbfd4dd9669fd949ae80794d05e61dbfe3060c Mon Sep 17 00:00:00 2001 From: Malte Tammena Date: Fri, 6 May 2022 22:59:56 +0200 Subject: [PATCH] [user/malte] Update gtk theme/icons --- flake.lock | 17 ---------------- flake.nix | 4 ---- pkgs/gruvbox-material-gtk.nix | 37 +++++++++++++++++++++++------------ users/malte/gtk.nix | 10 +++++----- 4 files changed, 30 insertions(+), 38 deletions(-) diff --git a/flake.lock b/flake.lock index b033843..d32a153 100644 --- a/flake.lock +++ b/flake.lock @@ -286,22 +286,6 @@ "url": "https://git.sr.ht/~megamanmalte/GLaDOS" } }, - "gruvbox-material-gtk": { - "flake": false, - "locked": { - "lastModified": 1627185282, - "narHash": "sha256-1O34p9iZelqRFBloOSZkxV0Z/7Jffciptpj3fwXPHbc=", - "owner": "sainnhe", - "repo": "gruvbox-material-gtk", - "rev": "cc255d43322ad646bb35924accb0778d5e959626", - "type": "github" - }, - "original": { - "owner": "sainnhe", - "repo": "gruvbox-material-gtk", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -770,7 +754,6 @@ "fend": "fend", "fenix": "fenix", "glados": "glados", - "gruvbox-material-gtk": "gruvbox-material-gtk", "home-manager": "home-manager", "hydra": "hydra", "mensa": "mensa", diff --git a/flake.nix b/flake.nix index 23dafb7..76a59f2 100644 --- a/flake.nix +++ b/flake.nix @@ -55,10 +55,6 @@ url = "github:NixOS/nix/5fe4fe823c193cbb7bfa05a468de91eeab09058d"; }; - gruvbox-material-gtk = { - url = "github:sainnhe/gruvbox-material-gtk"; - flake = false; - }; rip = { url = "github:nivekuil/rip"; flake = false; diff --git a/pkgs/gruvbox-material-gtk.nix b/pkgs/gruvbox-material-gtk.nix index 5c5a15e..1fb946f 100644 --- a/pkgs/gruvbox-material-gtk.nix +++ b/pkgs/gruvbox-material-gtk.nix @@ -2,34 +2,47 @@ lib, stdenv, fetchFromGitHub, + gtk3, + breeze-icons, + hicolor-icon-theme, hiDPI ? false, }: let - lock = builtins.fromJSON (builtins.readFile ../flake.lock); + name = "gruvbox-material-gtk"; + rev = "cc255d43322ad646bb35924accb0778d5e959626"; + sha256 = "1O34p9iZelqRFBloOSZkxV0Z/7Jffciptpj3fwXPHbc="; + variant = if hiDPI then "Gruvbox-Material-Dark-HIDPI" else "Gruvbox-Material-Dark"; in - stdenv.mkDerivation rec { - pname = lock.nodes.gruvbox-material-gtk.locked.repo; - version = lock.nodes.gruvbox-material-gtk.locked.rev; + stdenv.mkDerivation { + pname = name; + version = rev; src = fetchFromGitHub { - owner = lock.nodes.gruvbox-material-gtk.locked.owner; - repo = lock.nodes.gruvbox-material-gtk.locked.repo; - rev = lock.nodes.gruvbox-material-gtk.locked.rev; - sha256 = lock.nodes.gruvbox-material-gtk.locked.narHash; + inherit rev sha256; + owner = "TheGreatMcPain"; + repo = name; }; + nativeBuildInputs = [gtk3]; + propagatedBuildInputs = [breeze-icons hicolor-icon-theme]; + installPhase = '' - mkdir -p $out/share/themes/gruvbox-material - rm -rf README.md LICENSE demo.png icons - cp -r themes/${variant}/* $out/share/themes/gruvbox-material + rm -rf README.md LICENSE demo.png + mkdir -p $out/share/themes/Gruvbox-Material-Dark + cp -r themes/${variant}/* $out/share/themes/Gruvbox-Material-Dark + mkdir -p $out/share/icons/Gruvbox-Material-Dark + cp -r icons/Gruvbox-Material-Dark/* $out/share/icons/Gruvbox-Material-Dark + gtk-update-icon-cache $out/share/icons/Gruvbox-Material-Dark ''; + dontDropIconThemeCache = true; + meta = with lib; { description = "Gruvbox Material for GTK"; - homepage = "https://github.com/sainnhe/gruvbox-material-gtk"; + homepage = "https://github.com/TheGreatMcPain/gruvbox-material-gtk"; license = licenses.mit; platforms = platforms.unix; maintainers = []; diff --git a/users/malte/gtk.nix b/users/malte/gtk.nix index 97e490e..786fbc0 100644 --- a/users/malte/gtk.nix +++ b/users/malte/gtk.nix @@ -5,6 +5,7 @@ ... }: let hiDPI = nixosConfig.hardware.video.hidpi.enable; + pkg = pkgs.callPackage ../../pkgs/gruvbox-material-gtk.nix {inherit hiDPI;}; in rec { home.packages = with pkgs; [ numix-cursor-theme @@ -14,13 +15,12 @@ in rec { gtk = { enable = true; theme = { - package = - pkgs.callPackage ../../pkgs/gruvbox-material-gtk.nix {inherit hiDPI;}; - name = "gruvbox-material"; + package = pkg; + name = "Gruvbox-Material-Dark"; }; iconTheme = { - package = pkgs.paper-icon-theme; - name = "Paper-Mono-Dark"; + package = pkg; + name = "Gruvbox-Material-Dark"; }; gtk2 = {