diff --git a/modules/programs/tealdeer.nix b/modules/programs/tealdeer.nix index f0e610c2..08ba9d3f 100644 --- a/modules/programs/tealdeer.nix +++ b/modules/programs/tealdeer.nix @@ -49,5 +49,10 @@ in { home.file."${configDir}/tealdeer/config.toml" = mkIf (cfg.settings != { }) { source = tomlFormat.generate "tealdeer-config" cfg.settings; }; + + home.activation.tealdeerCache = hm.dag.entryAfter [ "linkGeneration" ] '' + $VERBOSE_ECHO "Rebuilding tealdeer cache" + $DRY_RUN_CMD ${getExe pkgs.tealdeer} --update + ''; }; } diff --git a/tests/default.nix b/tests/default.nix index 17e78d91..b3e963bb 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -140,6 +140,7 @@ in import nmtSrc { ./modules/programs/ssh ./modules/programs/starship ./modules/programs/taskwarrior + ./modules/programs/tealdeer ./modules/programs/texlive ./modules/programs/thefuck ./modules/programs/tmate diff --git a/tests/modules/programs/tealdeer/default-settings.nix b/tests/modules/programs/tealdeer/default-settings.nix new file mode 100644 index 00000000..0044ca8f --- /dev/null +++ b/tests/modules/programs/tealdeer/default-settings.nix @@ -0,0 +1,12 @@ +{ config, ... }: { + config = { + programs.tealdeer = { + package = config.lib.test.mkStubPackage { name = "tldr"; }; + enable = true; + }; + + nmt.script = '' + assertFileRegex activate '/nix/store/.*tealdeer.*/bin/tldr --update' + ''; + }; +} diff --git a/tests/modules/programs/tealdeer/default.nix b/tests/modules/programs/tealdeer/default.nix new file mode 100644 index 00000000..e9deed93 --- /dev/null +++ b/tests/modules/programs/tealdeer/default.nix @@ -0,0 +1 @@ +{ tealdeer-default-settings = ./default-settings.nix; }