From 7461de05bb9f5006f9195afece78f6fb69f45e2c Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Tue, 28 Nov 2023 11:24:34 +0100 Subject: [PATCH] feat(templates): move templates to a better name --- tex.nix => templates/tex.nix | 0 templates/typst.flake.nix | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) rename tex.nix => templates/tex.nix (100%) create mode 100644 templates/typst.flake.nix diff --git a/tex.nix b/templates/tex.nix similarity index 100% rename from tex.nix rename to templates/tex.nix diff --git a/templates/typst.flake.nix b/templates/typst.flake.nix new file mode 100644 index 0000000..a545f6b --- /dev/null +++ b/templates/typst.flake.nix @@ -0,0 +1,35 @@ +{ + description = "Nightly Typst with Typst LSP"; + + inputs.typst-lsp.url = "github:nvarner/typst-lsp"; + inputs.typst.url = "github:typst/typst"; + inputs.utils.url = "github:numtide/flake-utils"; + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + + outputs = { + nixpkgs, + utils, + typst, + typst-lsp, + ... + }: + utils.lib.eachDefaultSystem (system: let + typst-overlay = _self: _super: { + typst-lsp = typst-lsp.packages.${system}.default; + typst = typst.packages.${system}.default.overrideAttrs (_old: { + dontCheck = true; + }); + }; + pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [typst-overlay]; + typst-shell = pkgs.mkShell { + nativeBuildInputs = [ + pkgs.typst-lsp + pkgs.typst + ]; + }; + in { + devShells.default = typst-shell; + overlays.default = typst-overlay; + legacyPackages = pkgs; + }); +}