1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

system-packages: link applications to ~/Applications

This commit is contained in:
Daiderd Jordan 2017-05-20 14:23:05 +02:00
parent e88b408ee7
commit 290b1d8aad
No known key found for this signature in database
GPG key ID: D02435D05B810C96
4 changed files with 38 additions and 0 deletions

View file

@ -27,6 +27,7 @@ let
./modules/system/defaults/dock.nix
./modules/system/defaults/finder.nix
./modules/system/defaults/trackpad.nix
./modules/system/applications.nix
./modules/system/etc.nix
./modules/system/launchd.nix
./modules/time

View file

@ -56,6 +56,7 @@ in
${cfg.activationScripts.nix.text}
${cfg.activationScripts.accessibility.text}
${cfg.activationScripts.applications.text}
${cfg.activationScripts.etc.text}
${cfg.activationScripts.launchd.text}
${cfg.activationScripts.time.text}

View file

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.system;
in
{
options = {
};
config = {
system.build.applications = pkgs.buildEnv {
name = "system-applications";
paths = config.environment.systemPackages;
pathsToLink = "/Applications";
};
system.activationScripts.applications.text = ''
# Set up applications.
echo "setting up ~/Applications..." >&2
if [ -d ~/Applications ]; then
echo "warning: ~/Applications is a directory, skipping..." >&2
else
ln -sfn ${cfg.build.applications}/Applications ~/Applications
fi
'';
};
}

View file

@ -91,6 +91,7 @@ in
ln -s ${cfg.path} $out/sw
mkdir -p $out/Library
ln -s ${cfg.build.applications}/Applications $out/Applications
ln -s ${cfg.build.launchd}/Library/LaunchAgents $out/Library/LaunchAgents
ln -s ${cfg.build.launchd}/Library/LaunchDaemons $out/Library/LaunchDaemons