tldr-update: init (#6401)

Adds `tldr-update` module for enabling automatic `tldr update` on a schedule.
Adds option to `tealdeer` to enable integration with new `tldr-update` module.
This commit is contained in:
Perchun Pak 2025-02-10 15:34:12 +01:00 committed by GitHub
parent 5af1b9a0f1
commit b0bd29bb4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 101 additions and 0 deletions

View file

@ -370,6 +370,7 @@ in import nmtSrc {
./modules/services/swayosd
./modules/services/sxhkd
./modules/services/syncthing/linux
./modules/services/tldr-update
./modules/services/trayer
./modules/services/trayscale
./modules/services/twmn

View file

@ -0,0 +1 @@
{ tldr-update = ./tldr-update.nix; }

View file

@ -0,0 +1,21 @@
{ config, ... }:
{
config = {
home.stateVersion = "24.11";
services.tldr-update = {
enable = true;
package = config.lib.test.mkStubPackage { outPath = "@tldr@"; };
period = "monthly";
};
nmt.script = ''
serviceFile=$(normalizeStorePaths home-files/.config/systemd/user/tldr-update.service)
assertFileContent "$serviceFile" ${./tldr-update.service}
timerFile=$(normalizeStorePaths home-files/.config/systemd/user/tldr-update.timer)
assertFileContent "$timerFile" ${./tldr-update.timer}
'';
};
}

View file

@ -0,0 +1,8 @@
[Service]
ExecStart=@tldr@/bin/dummy --update
Type=oneshot
[Unit]
Description=Update tldr CLI cache
Documentation=https://tldr.sh/

View file

@ -0,0 +1,9 @@
[Install]
WantedBy=timers.target
[Timer]
OnCalendar=monthly
Persistent=true
[Unit]
Description=Update tldr CLI cache