19 lines
722 B
Nix
19 lines
722 B
Nix
# adapted from
|
|
# https://github.com/reckenrode/nixos-configs/blob/2acd7b0699fd57628deb7b8855b4d5f0ea8f8cb1/common/darwin/home-manager/copyApplications.nix
|
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
home.activation = lib.optionalAttrs pkgs.stdenv.isDarwin {
|
|
copyApplications = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
appsSrc="${config.home.homeDirectory}/Applications/Nix Apps/"
|
|
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 sudo ${pkgs.rsync}/bin/rsync ''${VERBOSE_ARG:+-v} $rsyncArgs "$appsSrc" "$baseDir"
|
|
fi
|
|
'';
|
|
};
|
|
}
|