pinact: 1.0.0 -> 1.1.2 and set CGO_ENABLED=0 (#368078)
[NixPkgs.git] / pkgs / by-name / ca / catppuccin-discord / package.nix
blobf98ffeca35fb7261ae0d7fbab86b79288d921293
2   lib,
3   stdenvNoCC,
4   fetchFromGitHub,
5   yarnConfigHook,
6   npmHooks,
7   nodejs-slim,
8   fetchYarnDeps,
9   flavour ? [ "mocha" ],
10   accents ? [ "blue" ],
12 let
13   validFlavours = [
14     "mocha"
15     "macchiato"
16     "frappe"
17     "latte"
18   ];
19   validAccents = [
20     "rosewater"
21     "flamingo"
22     "pink"
23     "mauve"
24     "red"
25     "maroon"
26     "peach"
27     "yellow"
28     "green"
29     "teal"
30     "sky"
31     "sapphire"
32     "blue"
33     "lavender"
34   ];
36 lib.checkListOfEnum "Invalid accent, valid accents are ${toString validAccents}" validAccents
37   accents
38   lib.checkListOfEnum
39   "Invalid flavour, valid flavours are ${toString validFlavours}"
40   validFlavours
41   flavour
42   stdenvNoCC.mkDerivation
43   (finalAttrs: {
44     pname = "catppuccin-discord";
45     version = "0-unstable-2024-12-08";
47     src = fetchFromGitHub {
48       owner = "catppuccin";
49       repo = "discord";
50       rev = "16b1e5156583ee376ded4fa602842fa540826bbc";
51       hash = "sha256-ECVHRuHbe3dvwrOsi6JAllJ37xb18HaUPxXoysyPP70=";
52     };
54     nativeBuildInputs = [
55       yarnConfigHook
56       npmHooks.npmInstallHook
57       nodejs-slim
58     ];
60     yarnOfflineCache = fetchYarnDeps {
61       yarnLock = "${finalAttrs.src}/yarn.lock";
62       hash = "sha256-2N4UI6Ap+zk7jtDCAsjGtwfDSiyOtB9YDOXUxYRCw60=";
63     };
65     buildPhase = ''
66       runHook preBuild
68       export HOME=$(mktemp -d)
69       yarn --offline release
71       runHook postBuild
72     '';
74     # "true" disables the dist phase, as there are no binaries and installation of themes
75     # will be handled in installPhase below.
76     distPhase = "true";
78     installPhase = ''
79       runHook preInstall
81       mkdir -p $out/share
83       for FLAVOUR in ${toString flavour}; do
84         for ACCENT in ${toString accents}; do
85           cp -va dist/dist/catppuccin-"$FLAVOUR"-"$ACCENT".theme.css $out/share
86         done;
87       done;
89       runHook postInstall
90     '';
92     meta = {
93       description = "Soothing pastel theme for Discord";
94       homepage = "https://github.com/catppuccin/discord";
95       license = lib.licenses.mit;
96       maintainers = with lib.maintainers; [ NotAShelf ];
97       platforms = lib.platforms.all;
98       sourceProvenance = with lib.sourceTypes; [ fromSource ];
99     };
100   })