mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
tealdeer: add cache update activation script
Calls 'tldr --update' on home-manager switch
This commit is contained in:
parent
3df2a80f3f
commit
6b28ab2d79
4 changed files with 19 additions and 0 deletions
|
@ -49,5 +49,10 @@ in {
|
||||||
home.file."${configDir}/tealdeer/config.toml" = mkIf (cfg.settings != { }) {
|
home.file."${configDir}/tealdeer/config.toml" = mkIf (cfg.settings != { }) {
|
||||||
source = tomlFormat.generate "tealdeer-config" 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
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,6 +140,7 @@ in import nmtSrc {
|
||||||
./modules/programs/ssh
|
./modules/programs/ssh
|
||||||
./modules/programs/starship
|
./modules/programs/starship
|
||||||
./modules/programs/taskwarrior
|
./modules/programs/taskwarrior
|
||||||
|
./modules/programs/tealdeer
|
||||||
./modules/programs/texlive
|
./modules/programs/texlive
|
||||||
./modules/programs/thefuck
|
./modules/programs/thefuck
|
||||||
./modules/programs/tmate
|
./modules/programs/tmate
|
||||||
|
|
12
tests/modules/programs/tealdeer/default-settings.nix
Normal file
12
tests/modules/programs/tealdeer/default-settings.nix
Normal file
|
@ -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'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
1
tests/modules/programs/tealdeer/default.nix
Normal file
1
tests/modules/programs/tealdeer/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ tealdeer-default-settings = ./default-settings.nix; }
|
Loading…
Reference in a new issue