2017-05-20 12:23:05 +00:00
|
|
|
{ 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
|
|
|
|
|
2017-05-20 12:38:32 +00:00
|
|
|
if [ ! -e ~/Applications -o -L ~/Applications ]; then
|
2017-05-20 12:23:05 +00:00
|
|
|
ln -sfn ${cfg.build.applications}/Applications ~/Applications
|
2017-06-09 21:51:59 +00:00
|
|
|
elif [ ! -e ~/Applications/Nix\ Apps -o -L ~/Applications/Nix\ Apps ]; then
|
|
|
|
ln -sfn ${cfg.build.applications}/Applications ~/Applications/Nix\ Apps
|
2017-05-20 12:38:32 +00:00
|
|
|
else
|
2017-06-09 21:51:59 +00:00
|
|
|
echo "warning: ~/Applications and ~/Applications/Nix Apps are directories, skipping App linking..." >&2
|
2017-05-20 12:23:05 +00:00
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|