1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-25 03:09:47 +01:00

tealdeer: add option to toggle update on activation

This is a network operation that can take awhile if you're on a shitty
connection.
This commit is contained in:
Carl Hjerpe 2024-01-28 21:18:29 +01:00 committed by Mikilio
parent 910d316355
commit 81b1f92eea
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F

View file

@ -17,6 +17,14 @@ in {
options.programs.tealdeer = {
enable = mkEnableOption "Tealdeer";
updateOnActivation = mkOption {
type = with types; bool;
default = true;
description = ''
Whether to update tealdeer's cache on activation.
'';
};
settings = mkOption {
type = tomlFormat.type;
default = { };
@ -50,9 +58,11 @@ in {
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
'';
home.activation = mkIf cfg.updateOnActivation {
tealdeerCache = hm.dag.entryAfter [ "linkGeneration" ] ''
$VERBOSE_ECHO "Rebuilding tealdeer cache"
$DRY_RUN_CMD ${getExe pkgs.tealdeer} --update
'';
};
};
}