This commit is contained in:
parent
e2ff82b759
commit
9afd5f51c5
5 changed files with 486 additions and 31 deletions
79
flake.nix
79
flake.nix
|
|
@ -34,57 +34,74 @@
|
|||
'';
|
||||
};
|
||||
|
||||
src = typixLib.cleanTypstSource ./.;
|
||||
commonArgs = {
|
||||
typstSource = "src/main.typ";
|
||||
typstOutput = "out/main.pdf";
|
||||
mkTypst = entry: rec {
|
||||
src = typixLib.cleanTypstSource ./.;
|
||||
commonArgs = {
|
||||
typstSource = "src/${entry}.typ";
|
||||
typstOutput = "out/${entry}.pdf";
|
||||
|
||||
fontPaths = [ ];
|
||||
fontPaths = [
|
||||
"${pkgs.inter}/share/fonts/truetype"
|
||||
];
|
||||
|
||||
virtualPaths = [ ];
|
||||
virtualPaths = [ ];
|
||||
};
|
||||
|
||||
commonBuildArgs = commonArgs // {
|
||||
XDG_CACHE_HOME = typstPackagesCache;
|
||||
};
|
||||
|
||||
build-drv = typixLib.buildTypstProject (
|
||||
commonBuildArgs
|
||||
// {
|
||||
inherit src;
|
||||
}
|
||||
);
|
||||
|
||||
build-script = typixLib.buildTypstProjectLocal (
|
||||
commonBuildArgs
|
||||
// {
|
||||
inherit src;
|
||||
}
|
||||
);
|
||||
|
||||
watch-script = typixLib.watchTypstProject commonArgs;
|
||||
};
|
||||
|
||||
commonBuildArgs = commonArgs // {
|
||||
XDG_CACHE_HOME = typstPackagesCache;
|
||||
};
|
||||
|
||||
build-drv = typixLib.buildTypstProject (
|
||||
commonBuildArgs
|
||||
// {
|
||||
inherit src;
|
||||
}
|
||||
);
|
||||
|
||||
build-script = typixLib.buildTypstProjectLocal (
|
||||
commonBuildArgs
|
||||
// {
|
||||
inherit src;
|
||||
}
|
||||
);
|
||||
|
||||
watch-script = typixLib.watchTypstProject commonArgs;
|
||||
typstMain = mkTypst "main";
|
||||
typstWork = mkTypst "work";
|
||||
in
|
||||
{
|
||||
checks = {
|
||||
inherit build-drv build-script watch-script;
|
||||
inherit (typstMain) build-drv build-script watch-script;
|
||||
# inherit (typstWork) build-drv build-script watch-script;
|
||||
};
|
||||
|
||||
packages.default = build-drv;
|
||||
packages = {
|
||||
default = typstMain.build-drv;
|
||||
work = typstWork.build-drv;
|
||||
};
|
||||
|
||||
apps = rec {
|
||||
default = watch;
|
||||
build = inputs.flake-utils.lib.mkApp {
|
||||
drv = build-script;
|
||||
drv = typstMain.build-script;
|
||||
};
|
||||
watch = inputs.flake-utils.lib.mkApp {
|
||||
drv = watch-script;
|
||||
drv = typstMain.watch-script;
|
||||
};
|
||||
build-work = inputs.flake-utils.lib.mkApp {
|
||||
drv = typstWork.build-script;
|
||||
};
|
||||
watch-work = inputs.flake-utils.lib.mkApp {
|
||||
drv = typstWork.watch-script;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = typixLib.devShell {
|
||||
inherit (commonArgs) fontPaths virtualPaths;
|
||||
inherit (typstMain.commonArgs) fontPaths virtualPaths;
|
||||
packages = [
|
||||
watch-script
|
||||
typstMain.watch-script
|
||||
pkgs.typstyle
|
||||
pkgs.tinymist
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue