Merge catppuccin-userstyles-nix: flake exports stylusSettings, builds from in-repo styles offline
This commit is contained in:
1 parent
7e3ce35890
commit
68285a17b1
12 files changed
+1173
-18
No files matched your search
@@ -0,0 +1,37 @@
|
||||
{
|
||||
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 copy (sandbox has no network)
|
||||
grep -rl 'https://userstyles.catppuccin.com/lib/lib.less' styles | xargs sed -i "s|https://userstyles.catppuccin.com/lib/lib.less|$src/lib/lib.less|"
|
||||
DENO_DIR=$PWD/deno_cache stylus-storage-gen "$PWD/styles" "${userstylesOptionsFile}"
|
||||
cp storage.js $out/share/
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Soothing pastel userstyles";
|
||||
homepage = "https://github.com/catppuccin/userstyles";
|
||||
license = with lib.licenses; [ mit ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
lib,
|
||||
buildNpmPackage,
|
||||
}:
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "stylus-storage-gen";
|
||||
version = "0.2.0";
|
||||
|
||||
src = builtins.path {
|
||||
path = ../stylus-storage-gen;
|
||||
name = finalAttrs.pname + "-src";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-lD9SbhexYCu0yYRkNihLz3xRMMwrl3Ls3aV2EDe5k5U=";
|
||||
|
||||
meta = {
|
||||
description = "Stylus storage.js file generator, compatible with Catppuccin Userstyles";
|
||||
license = with lib.licenses; [ mit ];
|
||||
platforms = lib.platforms.all;
|
||||
mainProgram = "stylus-storage-gen";
|
||||
};
|
||||
})
|
||||
Reference in new issue
Block a user