Skip to content

Commit

Permalink
catppuccin-discord: init at 0-unstable-2024-12-08 (NixOS#365773)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman authored Dec 19, 2024
2 parents 4bcc573 + db28586 commit a20c40f
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions pkgs/by-name/ca/catppuccin-discord/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
yarnConfigHook,
npmHooks,
nodejs-slim,
fetchYarnDeps,
flavour ? [ "mocha" ],
accents ? [ "blue" ],
}:
let
validFlavours = [
"mocha"
"macchiato"
"frappe"
"latte"
];
validAccents = [
"rosewater"
"flamingo"
"pink"
"mauve"
"red"
"maroon"
"peach"
"yellow"
"green"
"teal"
"sky"
"sapphire"
"blue"
"lavender"
];
in
lib.checkListOfEnum "Invalid accent, valid accents are ${toString validAccents}" validAccents
accents
lib.checkListOfEnum
"Invalid flavour, valid flavours are ${toString validFlavours}"
validFlavours
flavour
stdenvNoCC.mkDerivation
(finalAttrs: {
pname = "catppuccin-discord";
version = "0-unstable-2024-12-08";

src = fetchFromGitHub {
owner = "catppuccin";
repo = "discord";
rev = "16b1e5156583ee376ded4fa602842fa540826bbc";
hash = "sha256-ECVHRuHbe3dvwrOsi6JAllJ37xb18HaUPxXoysyPP70=";
};

nativeBuildInputs = [
yarnConfigHook
npmHooks.npmInstallHook
nodejs-slim
];

yarnOfflineCache = fetchYarnDeps {
yarnLock = "${finalAttrs.src}/yarn.lock";
hash = "sha256-2N4UI6Ap+zk7jtDCAsjGtwfDSiyOtB9YDOXUxYRCw60=";
};

buildPhase = ''
runHook preBuild
export HOME=$(mktemp -d)
yarn --offline release
runHook postBuild
'';

# "true" disables the dist phase, as there are no binaries and installation of themes
# will be handled in installPhase below.
distPhase = "true";

installPhase = ''
runHook preInstall
mkdir -p $out/share
for FLAVOUR in ${toString flavour}; do
for ACCENT in ${toString accents}; do
cp -va dist/dist/catppuccin-"$FLAVOUR"-"$ACCENT".theme.css $out/share
done;
done;
runHook postInstall
'';

meta = {
description = "Soothing pastel theme for Discord";
homepage = "https://github.com/catppuccin/discord";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ NotAShelf ];
platforms = lib.platforms.all;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
};
})

0 comments on commit a20c40f

Please sign in to comment.