dotfiles.nix/home/copyApplications.nix

16 lines
498 B
Nix
Raw Normal View History

2022-04-20 23:44:53 +00:00
{ pkgs, lib, ... }:
{
home.activation = {
copyApplications = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
appsSrc="$newGenPath/home-path/Applications/"
if [ -d "$appsSrc" ]; then
baseDir="$HOME/Applications/Home Manager Apps"
rsyncArgs="--archive --checksum --chmod=-w --copy-unsafe-links --delete"
$DRY_RUN_CMD mkdir -p "$baseDir"
$DRY_RUN_CMD ${pkgs.rsync}/bin/rsync ''${VERBOSE_ARG:+-v} $rsyncArgs "$appsSrc" "$baseDir"
fi
'';
};
}