evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / ca / catppuccin / package.nix
blobc547de3b3c47e214b809a8f593edadeab1649456
1 let
2   validThemes = [ "bat" "bottom" "btop" "grub" "hyprland" "k9s" "kvantum" "lazygit" "lxqt" "plymouth" "qt5ct" "refind" "rofi" "starship" "thunderbird" "waybar" ];
3 in
4 { fetchFromGitHub
5 , lib
6 , stdenvNoCC
7 , accent ? "blue"
8 , variant ? "macchiato"
9 , themeList ? validThemes
11 let
12   pname = "catppuccin";
14   validAccents = [ "rosewater" "flamingo" "pink" "mauve" "red" "maroon" "peach" "yellow" "green" "teal" "sky" "sapphire" "blue" "lavender" ];
15   validVariants = [ "latte" "frappe" "macchiato" "mocha" ];
17   selectedSources = map (themeName: builtins.getAttr themeName sources) themeList;
18   sources = {
19     bat = fetchFromGitHub {
20       name = "bat";
21       owner = "catppuccin";
22       repo = "bat";
23       rev = "2bafe4454d8db28491e9087ff3a1382c336e7d27";
24       hash = "sha256-yHt3oIjUnljARaihalcWSNldtaJfVDfmfiecYfbzGs0=";
25     };
27     bottom = fetchFromGitHub {
28       name = "bottom";
29       owner = "catppuccin";
30       repo = "bottom";
31       rev = "c0efe9025f62f618a407999d89b04a231ba99c92";
32       hash = "sha256-VaHX2I/Gn82wJWzybpWNqU3dPi3206xItOlt0iF6VVQ=";
33     };
35     btop = fetchFromGitHub {
36       name = "btop";
37       owner = "catppuccin";
38       repo = "btop";
39       rev = "1.0.0";
40       hash = "sha256-J3UezOQMDdxpflGax0rGBF/XMiKqdqZXuX4KMVGTxFk=";
41     };
43     grub = fetchFromGitHub {
44       name = "grub";
45       owner = "catppuccin";
46       repo = "grub";
47       rev = "v1.0.0";
48       hash = "sha256-/bSolCta8GCZ4lP0u5NVqYQ9Y3ZooYCNdTwORNvR7M0=";
49     };
51     hyprland = fetchFromGitHub {
52       name = "hyprland";
53       owner = "catppuccin";
54       repo = "hyprland";
55       rev = "v1.2";
56       hash = "sha256-07B5QmQmsUKYf38oWU3+2C6KO4JvinuTwmW1Pfk8CT8=";
57     };
59     k9s = fetchFromGitHub {
60       name = "k9s";
61       owner = "catppuccin";
62       repo = "k9s";
63       rev = "590a762110ad4b6ceff274265f2fe174c576ce96";
64       hash = "sha256-EBDciL3F6xVFXvND+5duT+OiVDWKkFMWbOOSruQ0lus=";
65     };
67     kvantum = fetchFromGitHub {
68       name = "kvantum";
69       owner = "catppuccin";
70       repo = "Kvantum";
71       rev = "d1e174c85311de9715aefc1eba4b8efd6b2730fc";
72       hash = "sha256-IrHo8pnR3u90bq12m7FEXucUF79+iub3I9vgH5h86Lk=";
73     };
75     lazygit = fetchFromGitHub {
76       name = "lazygit";
77       owner = "catppuccin";
78       repo = "lazygit";
79       rev = "v2.0.0";
80       hash = "sha256-gM0HplHhcpvtpmIVdlX/p59h0v+ihKEidS1imqPYlBg=";
81     };
83     lxqt = fetchFromGitHub {
84       name = "lxqt";
85       owner = "catppuccin";
86       repo = "lxqt";
87       rev = "38cf86b3e499e0c0928a102c9c030e5dc6b79255";
88       hash = "sha256-3TuUkOwk6BSc7BnLnTowGAkSlNTOtGTRlEcjJ6MNJ5g=";
89     };
91     plymouth = fetchFromGitHub {
92       name = "plymouth";
93       owner = "catppuccin";
94       repo = "plymouth";
95       rev = "67759fbe15eb9490d096ef8014d9f92fc5748fe7";
96       hash = "sha256-IzoyVOi44Uay7DTfzR9RdRLSjORsdBM4pPrgeXk5YMI=";
97     };
99     qt5ct = fetchFromGitHub {
100       name = "qt5ct";
101       owner = "catppuccin";
102       repo = "qt5ct";
103       rev = "89ee948e72386b816c7dad72099855fb0d46d41e";
104       hash = "sha256-t/uyK0X7qt6qxrScmkTU2TvcVJH97hSQuF0yyvSO/qQ=";
105     };
107     refind = fetchFromGitHub {
108       name = "refind";
109       owner = "catppuccin";
110       repo = "refind";
111       rev = "ff0b593c19bb9b469ee0ee36068b8d373f0fadc5";
112       hash = "sha256-itUMo0lA23bJzH0Ndq7L2IaEYoVdNPYxbB/VWkRfRso=";
113     };
115     rofi = fetchFromGitHub {
116       name = "rofi";
117       owner = "catppuccin";
118       repo = "rofi";
119       rev = "5350da41a11814f950c3354f090b90d4674a95ce";
120       hash = "sha256-DNorfyl3C4RBclF2KDgwvQQwixpTwSRu7fIvihPN8JY=";
121     };
123     starship = fetchFromGitHub {
124       name = "starship";
125       owner = "catppuccin";
126       repo = "starship";
127       rev = "5629d2356f62a9f2f8efad3ff37476c19969bd4f";
128       hash = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0=";
129     };
131     thunderbird = fetchFromGitHub {
132       name = "thunderbird";
133       owner = "catppuccin";
134       repo = "thunderbird";
135       rev = "d61882ad9fd35909a75da6bb95fca38db552135c";
136       hash = "sha256-wn8//8lHScbbB1nEiDY8DphnLUMKZBFMc1GPaTRjTOY=";
137     };
139     waybar = fetchFromGitHub {
140       name = "waybar";
141       owner = "catppuccin";
142       repo = "waybar";
143       rev = "v1.0";
144       hash = "sha256-vfwfBE3iqIN1cGoItSssR7h0z6tuJAhNarkziGFlNBw=";
145     };
146   };
148 lib.checkListOfEnum "${pname}: variant" validVariants [ variant ]
149 lib.checkListOfEnum "${pname}: accent" validAccents [ accent ]
150 lib.checkListOfEnum "${pname}: themes" validThemes themeList
152 stdenvNoCC.mkDerivation {
153   inherit pname;
154   version = "unstable-2024-03-12";
156   srcs = selectedSources;
158   unpackPhase = ''
159     for s in $selectedSources; do
160       b=$(basename $s)
161       cp $s ''${b#*-}
162     done
163   '';
165   installPhase = ''
166     runHook preInstall
168     local capitalizedVariant=$(sed 's/^\(.\)/\U\1/' <<< "${variant}")
169     local capitalizedAccent=$(sed 's/^\(.\)/\U\1/' <<< "${accent}")
171   '' + lib.optionalString (lib.elem "bat" themeList) ''
172     mkdir -p $out/bat
173     cp "${sources.bat}/themes/Catppuccin "$capitalizedVariant".tmTheme" "$out/bat/"
175   '' + lib.optionalString (lib.elem "btop" themeList) ''
176     mkdir -p $out/btop
177     cp "${sources.btop}/themes/catppuccin_${variant}.theme" "$out/btop/"
179   '' + lib.optionalString (lib.elem "bottom" themeList) ''
180     mkdir -p $out/bottom
181     cp "${sources.bottom}/themes/${variant}.toml" "$out/bottom/"
183   '' + lib.optionalString (lib.elem "grub" themeList) ''
184     mkdir -p $out/grub
185     cp -r ${sources.grub}/src/catppuccin-${variant}-grub-theme/* "$out/grub/"
187   '' + lib.optionalString (lib.elem "hyprland" themeList) ''
188     mkdir -p $out/hyprland
189     cp "${sources.hyprland}/themes/${variant}.conf" "$out/hyprland/"
191   '' + lib.optionalString (lib.elem "k9s" themeList) ''
192     mkdir -p $out/k9s
193     cp "${sources.k9s}/dist/catppuccin-${variant}.yaml" "$out/k9s/"
194     cp "${sources.k9s}/dist/catppuccin-${variant}-transparent.yaml" "$out/k9s/"
196   '' + lib.optionalString (lib.elem "kvantum" themeList) ''
197     mkdir -p $out/share/Kvantum
198     cp -r ${sources.kvantum}/src/Catppuccin-"$capitalizedVariant"-"$capitalizedAccent" $out/share/Kvantum
200   '' + lib.optionalString (lib.elem "lazygit" themeList) ''
201     mkdir -p $out/lazygit/{themes,themes-mergable}
202     cp "${sources.lazygit}/themes/${variant}/${accent}.yml" "$out/lazygit/themes/"
203     cp "${sources.lazygit}/themes-mergable/${variant}/${accent}.yml" "$out/lazygit/themes-mergable/"
205   '' + lib.optionalString (lib.elem "lxqt" themeList) ''
206     mkdir -p $out/share/lxqt/themes/catppuccin-${variant}
207     cp -r ${sources.lxqt}/src/catppuccin-${variant}/* $out/share/lxqt/themes/catppuccin-${variant}/
209   '' + lib.optionalString (lib.elem "plymouth" themeList) ''
210     mkdir -p $out/share/plymouth/themes/catppuccin-${variant}
211     cp ${sources.plymouth}/themes/catppuccin-${variant}/* $out/share/plymouth/themes/catppuccin-${variant}
212     sed -i 's:\(^ImageDir=\)/usr:\1'"$out"':' $out/share/plymouth/themes/catppuccin-${variant}/catppuccin-${variant}.plymouth
214   '' + lib.optionalString (lib.elem "qt5ct" themeList) ''
215     mkdir -p $out/qt5ct
216     cp ${sources.qt5ct}/themes/Catppuccin-"$capitalizedVariant".conf $out/qt5ct/
218   '' + lib.optionalString (lib.elem "rofi" themeList) ''
219     mkdir -p $out/rofi
220     cp ${sources.rofi}/basic/.local/share/rofi/themes/catppuccin-${variant}.rasi $out/rofi/
222   '' + lib.optionalString (lib.elem "refind" themeList) ''
223     mkdir -p $out/refind/assets
224     cp ${sources.refind}/${variant}.conf $out/refind/
225     cp -r ${sources.refind}/assets/${variant} $out/refind/assets/
227   '' + lib.optionalString (lib.elem "starship" themeList) ''
228     mkdir -p $out/starship
229     cp ${sources.starship}/palettes/${variant}.toml $out/starship/
231   '' + lib.optionalString (lib.elem "thunderbird" themeList) ''
232     mkdir -p $out/thunderbird
233     cp ${sources.thunderbird}/themes/${variant}/${variant}-${accent}.xpi $out/thunderbird/
235   '' + lib.optionalString (lib.elem "waybar" themeList) ''
236     mkdir -p $out/waybar
237     cp ${sources.waybar}/${variant}.css $out/waybar/
239   '' + ''
240     runHook postInstall
241   '';
243   meta = {
244     description = "Soothing pastel themes";
245     homepage = "https://github.com/catppuccin/catppuccin";
246     license = lib.licenses.mit;
247     platforms = lib.platforms.all;
248     maintainers = [ lib.maintainers.khaneliman ];
249   };