Browse Source

Add macos specific path for linking apps into ~/Applications

master
Bryan Bennett 3 months ago
parent
commit
9f2bdb48f1
Signed by: bryan GPG Key ID: 4AF3A523BC147CA2
  1. 29
      lib/macos.nix

29
lib/macos.nix

@ -0,0 +1,29 @@
{config, pkgs, lib, ... }:
{
imports = [
./common.nix
# ./homebrew.nix
];
home.activation = {
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")"
echo "=> $appFile -> $target"
$DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir"
$DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target"
done
'';
};
}
Loading…
Cancel
Save