about summary refs log tree commit diff
path: root/pkgs/profpatsch/text-letter.nix
blob: 987bc8dd7e4b1fdab44968f7c816fc63c5dc1c19 (plain) (blame)
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
{ pkgs, rust-deps, writeRustSimple, writeExecline, getBins }:

let
  bins = getBins pkgs.coreutils [ "date" "cat" ]
      // getBins pkgs.paps [ "paps" ]
      // getBins pkgs.ghostscript [ "ps2pdf" ];

  mustache-interpol = writeRustSimple "mustache-interpol" {
    dependencies = [
      rust-deps.mustache
      rust-deps.toml
      rust-deps.regex
      rust-deps.lazy_static
    ];
  } (./text-letter.rs);

  text-letter = writeExecline "write-letter" {} [
    mustache-interpol
  ];

  text-letter-pdf = writeExecline "write-letter-pdf" {} [
    "pipeline" [ text-letter ]
    "pipeline" [ bins.paps "--encoding=utf8" ]
    bins.ps2pdf "-"
  ];

in {
   inherit
     mustache-interpol
     text-letter
     text-letter-pdf
     ;
}