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:
parent
e88b408ee7
commit
290b1d8aad
4 changed files with 38 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
|
35
modules/system/applications.nix
Normal file
35
modules/system/applications.nix
Normal 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
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue