mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-13 19:57:19 +00:00
28 lines
851 B
Nix
28 lines
851 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
# see https://github.com/nix-community/home-manager/issues/1341
|
|
|
|
{
|
|
disabledModules = [ "targets/darwin/linkapps.nix" ];
|
|
|
|
home.activation = lib.mkIf pkgs.stdenv.isDarwin {
|
|
copyApplications = let
|
|
apps = pkgs.buildEnv {
|
|
name = "home-manager-applications";
|
|
paths = config.home.packages;
|
|
pathsToLink = "/Applications";
|
|
};
|
|
in lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
baseDir="$HOME/Applications/Home Manager Apps"
|
|
if [ -d "$baseDir" ]; then
|
|
rm -rf "$baseDir"
|
|
fi
|
|
mkdir -p "$baseDir"
|
|
for appFile in ${apps}/Applications/*; do
|
|
target="$baseDir/$(basename "$appFile")"
|
|
$DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir"
|
|
$DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target"
|
|
done
|
|
'';
|
|
};
|
|
}
|