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 committed by Austin Horstman
parent 8b629b5424
commit 9556d3c2b4
7 changed files with 114 additions and 0 deletions

View file

@ -0,0 +1,31 @@
{ config, pkgs, ... }: {
config = {
programs.tex-fmt = {
enable = true;
settings = {
wrap = true;
tabsize = 2;
tabchar = "space";
lists = [ ];
};
};
nmt.script = let
expectedConfDir = if pkgs.stdenv.isDarwin then
"Library/Application Support"
else
".config";
expectedConfigPath = "home-files/${expectedConfDir}/tex-fmt/tex-fmt.toml";
in ''
assertFileExists "${expectedConfigPath}"
assertFileContent "${expectedConfigPath}" ${
pkgs.writeText "tex-fmt.config-custom.expected" ''
lists = []
tabchar = "space"
tabsize = 2
wrap = true
''
}
'';
};
}

View file

@ -0,0 +1,15 @@
{ config, pkgs, ... }: {
config = {
programs.tex-fmt = { enable = true; };
nmt.script = let
expectedConfDir = if pkgs.stdenv.isDarwin then
"Library/Application Support"
else
".config";
expectedConfigPath = "home-files/${expectedConfDir}/tex-fmt/tex-fmt.toml";
in ''
assertPathNotExists "${expectedConfigPath}"
'';
};
}

View file

@ -0,0 +1,4 @@
{
tex-fmt-default-settings = ./default-settings.nix;
tex-fmt-custom-settings = ./custom-settings.nix;
}