From 20c07d46b099a82096607a10cdc790188d641972 Mon Sep 17 00:00:00 2001 From: mat ess Date: Wed, 20 Apr 2022 19:44:53 -0400 Subject: [PATCH] Add copyApplications --- home/copyApplications.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 home/copyApplications.nix diff --git a/home/copyApplications.nix b/home/copyApplications.nix new file mode 100644 index 0000000..e2ad6d2 --- /dev/null +++ b/home/copyApplications.nix @@ -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 + ''; + }; +}