-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
45 lines (41 loc) · 1.39 KB
/
flake.nix
File metadata and controls
45 lines (41 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
description = "Promptyst: A contract-first Typst DSL for structured AI prompts";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
typix = {
url = "github:loqusion/typix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, flake-utils, typix, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
typixLib = typix.lib.${system};
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter = path: type:
type == "directory"
|| pkgs.lib.hasSuffix ".typ" path
|| pkgs.lib.hasSuffix ".toml" path
|| pkgs.lib.hasSuffix ".yaml" path;
};
mkTestCheck = testFile: typixLib.mkTypstDerivation {
name = "promptyst-${builtins.replaceStrings ["/"] ["-"] testFile}";
inherit src;
buildPhaseTypstCommand = "typst compile --root . ${testFile} output.pdf";
installPhaseCommand = "touch $out";
};
in {
checks = {
test-core = mkTestCheck "tests/test.typ";
test-ingest = mkTestCheck "tests/test-ingest.typ";
test-helpers = mkTestCheck "tests/test-helpers.typ";
};
devShells.default = typixLib.devShell {
packages = [ pkgs.just ];
};
}
);
}