2024-05-07 22:02:59 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
2024-12-06 18:04:47 +00:00
|
|
|
namespace,
|
2024-05-07 22:02:59 +00:00
|
|
|
...
|
|
|
|
}:
|
2024-05-02 01:10:26 +00:00
|
|
|
|
|
|
|
let
|
2024-12-06 18:04:47 +00:00
|
|
|
cfg = config.${namespace}.apps.writing;
|
2024-11-30 18:49:13 +00:00
|
|
|
|
|
|
|
compile-manuscript = pkgs.writeShellScriptBin "compile-manuscript" (
|
2024-12-06 18:04:47 +00:00
|
|
|
builtins.readFile ../../../../bin/compile-manuscript.sh
|
2024-11-30 18:49:13 +00:00
|
|
|
);
|
2024-05-02 01:10:26 +00:00
|
|
|
in
|
|
|
|
{
|
2024-05-07 22:02:59 +00:00
|
|
|
options = {
|
2024-12-06 18:04:47 +00:00
|
|
|
${namespace}.apps.writing.enable = lib.mkEnableOption "Enables writing and editing tools";
|
2024-05-07 22:02:59 +00:00
|
|
|
};
|
2024-05-02 01:10:26 +00:00
|
|
|
|
2024-06-19 18:00:17 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2024-05-07 22:02:59 +00:00
|
|
|
# Install packages for building ebooks
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
haskellPackages.pandoc
|
|
|
|
haskellPackages.pandoc-cli
|
|
|
|
haskellPackages.pandoc-crossref
|
2024-10-19 17:39:55 +00:00
|
|
|
(texlive.combine { inherit (texlive) scheme-small draftwatermark; })
|
2024-11-30 18:49:13 +00:00
|
|
|
compile-manuscript
|
2024-05-07 22:02:59 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|