diff options
| author | Maxwell Beck <max@rastertail.net> | 2026-07-16 18:44:41 -0500 |
|---|---|---|
| committer | Maxwell Beck <max@rastertail.net> | 2026-07-16 18:44:41 -0500 |
| commit | 710f36df89d5639171b7b5dddc437090e1bc051b (patch) | |
| tree | 4f8842bb7b326c2a2f9cc3896a52ccd7ac180f88 | |
| parent | 9c78ec8e532b69ee643f9b4346187a67a797990c (diff) | |
Modular boilerplate + MIT license
| -rw-r--r-- | LICENSE | 21 | ||||
| -rw-r--r-- | flake.lock | 19 | ||||
| -rw-r--r-- | flake.nix | 34 | ||||
| -rw-r--r-- | raster.typ | 33 | ||||
| -rw-r--r-- | setup-hook.sh | 13 | ||||
| -rw-r--r-- | typst.toml | 7 |
6 files changed, 58 insertions, 69 deletions
@@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Maxwell Beck + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. @@ -1,23 +1,6 @@ { "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1783776592, - "narHash": "sha256-+GVwKnbbSmf4cWMJyRzvw8H5yFknmkLoPD5v6snqPzo=", - "rev": "e7a3ca8092b61ff85b6a45bf863ea2b2d6a661b3", - "type": "tarball", - "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1032869.e7a3ca8092b6/nixexprs.tar.xz" - }, - "original": { - "type": "tarball", - "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } + "root": {} }, "root": "root", "version": 7 @@ -1,25 +1,23 @@ { - inputs = { - nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; - }; + inputs = { }; + + outputs = { self }: { + overlays.default = (self: pkgs: { + rastertype3 = pkgs.stdenvNoCC.mkDerivation rec { + pname = "rastertype3"; + version = "0.1.0"; - outputs = { self, nixpkgs }: let - system = "aarch64-darwin"; - pkgs = nixpkgs.legacyPackages.${system}; + src = ./.; - fonts = with pkgs; [ gyre-fonts ]; - in { - devShells.${system} = rec { - rastertype = pkgs.mkShell { - packages = [ pkgs.typst ]; - shellHook = '' - export TYPST_FONT_PATHS="${pkgs.symlinkJoin { name = "rastertype-fonts"; paths = fonts; }}/share/fonts" - export TYPST_IGNORE_SYSTEM_FONTS=true - export TYPST_IGNORE_EMBEDDED_FONTS=true - export TYPST_FEATURES=html + propagatedBuildInputs = [ pkgs.typst pkgs.gyre-fonts ]; + installPhase = '' + mkdir -p $out/typst/packages/local/rastertype3/${version}/ + cp raster.typ $out/typst/packages/local/rastertype3/${version}/ + cp typst.toml $out/typst/packages/local/rastertype3/${version}/ ''; + + setupHooks = [ ./setup-hook.sh ]; }; - default = rastertype; - }; + }); }; } @@ -63,36 +63,3 @@ rest } - -#show: rest => raster(paper: "us-letter", rest) - -Ok so here is some sample text where I once again do not know what to write. -I have been really hung over today which sucks. -I didn't even think I went that hard, but I guess a margharita and smoking past 10 PM will do it. -How unfortunate. - -= bleh - -#lorem(100) - -== bleh - -#lorem(30) - -#lorem(50) - -=== bleh - -#lorem(100) - -==== bleh - -#lorem(100) - -= bleh - -#lorem(100) - -== bleh - -#lorem(100) diff --git a/setup-hook.sh b/setup-hook.sh new file mode 100644 index 0000000..d413266 --- /dev/null +++ b/setup-hook.sh @@ -0,0 +1,13 @@ +addFonts() { + if [[ -v TYPST_FONT_PATHS ]]; then + export TYPST_FONT_PATHS="$1/share/fonts/:$TYPST_FONT_PATHS" + else + export TYPST_FONT_PATHS="$1/share/fonts/" + fi +} + +export TYPST_IGNORE_SYSTEM_FONTS=true +export TYPST_IGNORE_EMBEDDED_FONTS=true +export TYPST_PACKAGE_PATH=$1/typst/packages + +addEnvHooks "$targetOffset" addFonts diff --git a/typst.toml b/typst.toml new file mode 100644 index 0000000..caa868c --- /dev/null +++ b/typst.toml @@ -0,0 +1,7 @@ +[package] +name = "rastertype3" +version = "0.1.0" +entrypoint = "raster.typ" +authors = ["Maxwell Beck <max@rastertail.net>"] +license = "MIT" +description = "Personal typesetting templates and stuff" |
