tealdeer: module improvements
- Cache update on HM activation removed - freeformType settings - More tests added - Platform-dependent tests - Maintainer added
This commit is contained in:
parent
738527f866
commit
a54e05bc12
4 changed files with 101 additions and 32 deletions
35
tests/modules/programs/tealdeer/custom-settings.nix
Normal file
35
tests/modules/programs/tealdeer/custom-settings.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ config, pkgs, ... }: {
|
||||
config = {
|
||||
programs.tealdeer = {
|
||||
package = config.lib.test.mkStubPackage { name = "tldr"; };
|
||||
enable = true;
|
||||
settings = {
|
||||
updates = {
|
||||
auto_update = true;
|
||||
auto_update_interval_hours = 72;
|
||||
};
|
||||
display = { use_pager = false; };
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = let
|
||||
expectedConfDir = if pkgs.stdenv.isDarwin then
|
||||
"Library/Application Support"
|
||||
else
|
||||
".config";
|
||||
expectedConfigPath = "home-files/${expectedConfDir}/tealdeer/config.toml";
|
||||
in ''
|
||||
assertFileExists "${expectedConfigPath}"
|
||||
assertFileContent "${expectedConfigPath}" ${
|
||||
pkgs.writeText "tealdeer.config-custom.expected" ''
|
||||
[display]
|
||||
use_pager = false
|
||||
|
||||
[updates]
|
||||
auto_update = true
|
||||
auto_update_interval_hours = 72
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,12 +1,18 @@
|
|||
{ config, ... }: {
|
||||
{ config, pkgs, ... }: {
|
||||
config = {
|
||||
programs.tealdeer = {
|
||||
package = config.lib.test.mkStubPackage { name = "tldr"; };
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex activate '/nix/store/.*tealdeer.*/bin/tldr --update'
|
||||
nmt.script = let
|
||||
expectedConfDir = if pkgs.stdenv.isDarwin then
|
||||
"Library/Application Support"
|
||||
else
|
||||
".config";
|
||||
expectedConfigPath = "home-files/${expectedConfDir}/tealdeer/config.toml";
|
||||
in ''
|
||||
assertPathNotExists "${expectedConfigPath}"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1,4 @@
|
|||
{ tealdeer-default-settings = ./default-settings.nix; }
|
||||
{
|
||||
tealdeer-default-settings = ./default-settings.nix;
|
||||
tealdeer-custom-settings = ./custom-settings.nix;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue