mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +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:
parent
4d54c29bce
commit
d634c3abaf
1 changed files with 14 additions and 4 deletions
|
@ -17,6 +17,14 @@ in {
|
||||||
options.programs.tealdeer = {
|
options.programs.tealdeer = {
|
||||||
enable = mkEnableOption "Tealdeer";
|
enable = mkEnableOption "Tealdeer";
|
||||||
|
|
||||||
|
updateOnActivation = mkOption {
|
||||||
|
type = with types; bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to update tealdeer's cache on activation.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = tomlFormat.type;
|
type = tomlFormat.type;
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -50,9 +58,11 @@ in {
|
||||||
source = tomlFormat.generate "tealdeer-config" cfg.settings;
|
source = tomlFormat.generate "tealdeer-config" cfg.settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.activation.tealdeerCache = hm.dag.entryAfter [ "linkGeneration" ] ''
|
home.activation = mkIf cfg.updateOnActivation {
|
||||||
$VERBOSE_ECHO "Rebuilding tealdeer cache"
|
tealdeerCache = hm.dag.entryAfter [ "linkGeneration" ] ''
|
||||||
$DRY_RUN_CMD ${getExe pkgs.tealdeer} --update
|
$VERBOSE_ECHO "Rebuilding tealdeer cache"
|
||||||
'';
|
$DRY_RUN_CMD ${getExe pkgs.tealdeer} --update
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue