Build Stylus Export / build (push) Skipped
CI / ci (push) Skipped
Deno Check / check (push) Skipped
Lint Userstyles / lint (push) Skipped
Sync Maintainers / sync-maintainers (push) Skipped
Sync Labels / sync (push) Skipped
Deploy Docs to GH Pages / build (push) Canceled after 0s
Deploy Docs to GH Pages / deploy (push) Canceled after 0s
39 lines
1.1 KiB
Nix
39 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
src,
|
|
stylus-storage-gen,
|
|
userstylesOptions ? { },
|
|
}:
|
|
let
|
|
userstylesOptionsFile = builtins.toFile "catppuccin-userstyles-options" (
|
|
builtins.toJSON userstylesOptions
|
|
);
|
|
in
|
|
stdenv.mkDerivation {
|
|
pname = "catppuccin-stylus-storage";
|
|
version = "0.1.0";
|
|
|
|
inherit src;
|
|
|
|
nativeBuildInputs = [
|
|
stylus-storage-gen
|
|
];
|
|
|
|
buildPhase = ''
|
|
mkdir -p $out/share ./deno_cache
|
|
# styles @import lib/*.less from the web; use the in-repo copies (sandbox has no network)
|
|
grep -rl 'https://userstyles.catppuccin.com/lib/' styles | xargs sed -i "s|https://userstyles.catppuccin.com/lib/|$src/lib/|g"
|
|
DENO_DIR=$PWD/deno_cache stylus-storage-gen "$PWD/styles" "${userstylesOptionsFile}"
|
|
# restore the original import URL so storage.js holds no store paths
|
|
sed "s|$src/lib/|https://userstyles.catppuccin.com/lib/|g" storage.js > $out/share/storage.js
|
|
'';
|
|
|
|
meta = {
|
|
description = "Soothing pastel userstyles";
|
|
homepage = "https://github.com/catppuccin/userstyles";
|
|
license = with lib.licenses; [ mit ];
|
|
platforms = lib.platforms.all;
|
|
};
|
|
}
|