diff options
author | Nicolas Berbiche <nic.berbiche@gmail.com> | 2020-08-28 09:42:05 -0400 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2020-09-04 15:21:48 +0200 |
commit | d3aee544b686a72b2bb7eeb379f72c6b6b2665b7 (patch) | |
tree | 535b273147ad5a6832b9b41c5400e5e60cd9706e /modules | |
parent | bd4c2b06515fb7cdef9dda19bccd47f37aa66324 (diff) |
targets.darwin: add module
Currently, this module makes sure that `/Applications` directories for
packages in `home.packages` get linked into the user's environment.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/modules.nix | 1 | ||||
-rw-r--r-- | modules/targets/darwin.nix | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/modules/modules.nix b/modules/modules.nix index b4eb4d4027c..08c978b177d 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -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 { }) diff --git a/modules/targets/darwin.nix b/modules/targets/darwin.nix new file mode 100644 index 00000000000..0d434234bbb --- /dev/null +++ b/modules/targets/darwin.nix @@ -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"; + }; +} |