nixpkgs-suyu/pkgs/data/themes/mojave/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

59 lines
1.8 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fetchurl, glib, gtk-engine-murrine, gtk_engines, inkscape, optipng, sassc, which }:
stdenv.mkDerivation rec {
pname = "mojave-gtk-theme";
version = "2020-11-29";
srcs = [
(fetchFromGitHub {
owner = "vinceliuice";
repo = pname;
rev = version;
sha256 = "07lcg28y0scpii29j85343kmcga4wyaayjpx9a118z838mnvb757";
})
(fetchurl {
url = "https://github.com/vinceliuice/Mojave-gtk-theme/raw/11741a99d96953daf9c27e44c94ae50a7247c0ed/macOS_Mojave_Wallpapers.tar.xz";
sha256 = "18zzkwm1kqzsdaj8swf0xby1n65gxnyslpw4lnxcx1rphip0rwf7";
})
];
sourceRoot = "source";
nativeBuildInputs = [ glib inkscape optipng sassc which ];
buildInputs = [ gtk_engines ];
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
postPatch = ''
patchShebangs .
for f in render-assets.sh \
src/assets/gtk-2.0/render-assets.sh \
src/assets/gtk-3.0/common-assets/render-assets.sh \
src/assets/gtk-3.0/windows-assets/render-assets.sh \
src/assets/metacity-1/render-assets.sh \
src/assets/xfwm4/render-assets.sh
do
substituteInPlace $f \
--replace /usr/bin/inkscape ${inkscape}/bin/inkscape \
--replace /usr/bin/optipng ${optipng}/bin/optipng
done
# Shut up inkscape's warnings
export HOME="$NIX_BUILD_ROOT"
'';
installPhase = ''
name= ./install.sh -d $out/share/themes
install -D -t $out/share/wallpapers ../"macOS Mojave Wallpapers"/*
'';
meta = with lib; {
description = "Mac OSX Mojave like theme for GTK based desktop environments";
homepage = "https://github.com/vinceliuice/Mojave-gtk-theme";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = [ maintainers.romildo ];
};
}