Add copyApplications

work
mat ess 2022-04-20 19:44:53 -04:00
parent 7052c4d511
commit 20c07d46b0
1 changed files with 15 additions and 0 deletions

15
home/copyApplications.nix Normal file
View File

@ -0,0 +1,15 @@
{ 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
'';
};
}