2022-05-30 20:07:43 +00:00
|
|
|
{ config, pkgs, lib, ... }: {
|
|
|
|
|
|
|
|
home-manager.users.${config.user} = {
|
|
|
|
|
|
|
|
home.activation = {
|
|
|
|
|
|
|
|
# Always clone dotfiles repository if it doesn't exist
|
2022-05-30 20:14:02 +00:00
|
|
|
cloneDotfiles =
|
|
|
|
config.home-manager.users.${config.user}.lib.dag.entryAfter
|
|
|
|
[ "writeBoundary" ] ''
|
|
|
|
if [ ! -d "${config.dotfilesPath}" ]; then
|
2022-06-04 14:29:36 +00:00
|
|
|
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
|
|
|
$DRY_RUN_CMD ${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
2022-05-30 20:14:02 +00:00
|
|
|
fi
|
|
|
|
'';
|
2022-05-30 20:07:43 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2022-07-26 03:15:26 +00:00
|
|
|
# Set a variable for dotfiles repo, not necessary but convenient
|
|
|
|
home.sessionVariables.DOTS = config.dotfilesPath;
|
|
|
|
|
2022-05-30 20:07:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|