targets.darwin: add module

Currently, this module makes sure that `/Applications` directories for
packages in `home.packages` get linked into the user's environment.
This commit is contained in:
Nicolas Berbiche 2020-08-28 09:42:05 -04:00 committed by Robert Helgesson
parent bd4c2b0651
commit d3aee544b6
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
7 changed files with 39 additions and 1 deletions

View file

@ -189,6 +189,7 @@ let
(loadModule ./services/xscreensaver.nix { })
(loadModule ./services/xsuspender.nix { condition = hostPlatform.isLinux; })
(loadModule ./systemd.nix { })
(loadModule ./targets/darwin.nix { condition = hostPlatform.isDarwin; })
(loadModule ./targets/generic-linux.nix { condition = hostPlatform.isLinux; })
(loadModule ./xcursor.nix { })
(loadModule ./xresources.nix { })

View file

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
{
config = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
# Install MacOS applications to the user environment.
home.file."Applications/Home Manager Apps".source = let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
in "${apps}/Applications";
};
}