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:
parent
8b629b5424
commit
9556d3c2b4
7 changed files with 114 additions and 0 deletions
31
tests/modules/programs/tex-fmt/custom-settings.nix
Normal file
31
tests/modules/programs/tex-fmt/custom-settings.nix
Normal 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
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
15
tests/modules/programs/tex-fmt/default-settings.nix
Normal file
15
tests/modules/programs/tex-fmt/default-settings.nix
Normal 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}"
|
||||
'';
|
||||
};
|
||||
}
|
||||
4
tests/modules/programs/tex-fmt/default.nix
Normal file
4
tests/modules/programs/tex-fmt/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
tex-fmt-default-settings = ./default-settings.nix;
|
||||
tex-fmt-custom-settings = ./custom-settings.nix;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue