The activation scripts blocks to run when activating a Home Manager generation. Any entry here should be idempotent, meaning running twice or more times produces the same result as running it once.

If the script block produces any observable side effect, such as writing or deleting files, then it must be placed after the special writeBoundary script block. Prior to the write boundary one can place script blocks that verifies, but does not modify, the state of the system and exits if an unexpected state is found. For example, the checkLinkTargets script block checks for collisions between non-managed files and files defined in .

A script block should respect the DRY_RUN variable, if it is set then the actions taken by the script should be logged to standard out and not actually performed. The variable DRY_RUN_CMD is set to echo if dry run is enabled.

A script block should also respect the VERBOSE variable, and if set print information on standard out that may be useful for debugging any issue that may arise. The variable VERBOSE_ARG is set to --verbose if verbose output is enabled.

Declarations
Type
DAG of string
Default
{ }
Example
{
  myActivationAction = lib.hm.dag.entryAfter ["writeBoundary"] ''
    $DRY_RUN_CMD ln -s $VERBOSE_ARG \
        ${builtins.toPath ./link-me-directly} $HOME
  '';
}