nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitLab, autoreconfHook, pkg-config, parallel
2, sassc, inkscape, libxml2, glib, gtk_engines, gtk-engine-murrine
3, cinnamonSupport ? true
4, gnomeFlashbackSupport ? true
5, gnomeShellSupport ? true
6, openboxSupport ? true
7, xfceSupport ? true
8, mateSupport ? true, gtk3, marco
9, gtkNextSupport ? false
10, plankSupport ? false
11, steamSupport ? false
12, telegramSupport ? false, zip
13, tweetdeckSupport ? false
14, selectionColor ? null # Primary color for 'selected-items' (Default: #3F51B5 = Indigo500)
15, accentColor ? null # Secondary color for notifications and OSDs (Default: #7986CB = Indigo300)
16, suggestionColor ? null # Secondary color for 'suggested' buttons (Default: #673AB7 = DPurple500)
17, destructionColor ? null # Tertiary color for 'destructive' buttons (Default: #F44336 = Red500)
18}:
19
20stdenv.mkDerivation rec {
21 pname = "plata-theme";
22 version = "0.9.9";
23
24 src = fetchFromGitLab {
25 owner = "tista500";
26 repo = "plata-theme";
27 rev = version;
28 sha256 = "1iwvlv9qcrjyfbzab00vjqafmp3vdybz1hi02r6lwbgvwyfyrifk";
29 };
30
31 nativeBuildInputs = [
32 autoreconfHook
33 pkg-config
34 parallel
35 sassc
36 inkscape
37 libxml2
38 glib
39 ]
40 ++ lib.optionals mateSupport [ gtk3 marco ]
41 ++ lib.optional telegramSupport zip;
42
43 buildInputs = [ gtk_engines ];
44
45 propagatedUserEnvPkgs = [
46 gtk-engine-murrine
47 ];
48
49 postPatch = "patchShebangs .";
50
51 configureFlags =
52 let
53 inherit (lib) enableFeature optional;
54 withOptional = value: feat: optional (value != null) "--with-${feat}=${value}";
55 in [
56 "--enable-parallel"
57 (enableFeature cinnamonSupport "cinnamon")
58 (enableFeature gnomeFlashbackSupport "flashback")
59 (enableFeature gnomeShellSupport "gnome")
60 (enableFeature openboxSupport "openbox")
61 (enableFeature xfceSupport "xfce")
62 (enableFeature mateSupport "mate")
63 (enableFeature gtkNextSupport "gtk_next")
64 (enableFeature plankSupport "plank")
65 (enableFeature steamSupport "airforsteam")
66 (enableFeature telegramSupport "telegram")
67 (enableFeature tweetdeckSupport "tweetdeck")
68 ]
69 ++ (withOptional selectionColor "selection_color")
70 ++ (withOptional accentColor "accent_color")
71 ++ (withOptional suggestionColor "suggestion_color")
72 ++ (withOptional destructionColor "destruction_color");
73
74 postInstall = ''
75 for dest in $out/share/gtksourceview-{3.0,4}/styles; do
76 mkdir -p $dest
77 cp $out/share/themes/Plata-{Noir,Lumine}/gtksourceview/*.xml $dest
78 done
79 '';
80
81 meta = with lib; {
82 description = "A GTK theme based on Material Design Refresh";
83 homepage = "https://gitlab.com/tista500/plata-theme";
84 license = with licenses; [ gpl2 cc-by-sa-40 ];
85 platforms = platforms.linux;
86 maintainers = [ maintainers.tadfisher ];
87 };
88}