1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2025-01-30 12:55:02 +01:00

tex-fmt: add module

tex-fmt is a LaTeX source code formatter written in Rust, and uses
a user configuration file in the .toml format.
This commit is contained in:
William G Underwood 2024-12-30 21:56:04 +00:00
parent 10e99c43cd
commit f7552689d8
2 changed files with 41 additions and 0 deletions

View file

@ -236,6 +236,7 @@ let
./programs/tealdeer.nix
./programs/terminator.nix
./programs/termite.nix
./programs/tex-fmt.nix
./programs/texlive.nix
./programs/thefuck.nix
./programs/thunderbird.nix

View file

@ -0,0 +1,40 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.tex-fmt;
configPath = "${config.xdg.configHome}/tex-fmt/tex-fmt.toml";
in {
meta.maintainers = [ maintainers.wgunderwood ];
options = {
programs.tex-fmt = {
enable = mkEnableOption "tex-fmt";
package = mkPackageOption pkgs "tex-fmt" { };
options = mkOption {
default = { };
type = with types; attrsOf (oneOf [ str bool int ]);
description = ''
List of options to pass to tex-fmt.
See <https://github.com/WGUNDERWOOD/tex-fmt/blob/master/tex-fmt.toml>
for an example configuration.
'';
example = {
usetabs = true;
wraplen = 70;
};
};
};
};
config = mkIf cfg.enable {
home = mkMerge [
{ packages = [ cfg.package ]; }
(mkIf (cfg.options != [ ]) {
file."${configPath}".text = lib.concatLines cfg.options;
})
];
};
}