mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
targets/darwin: allow configuring application linking (#4809)
Darwin users can disable application linking or change the path where applications are linked.
This commit is contained in:
parent
cb3f6e9b59
commit
fb568d75cf
1 changed files with 18 additions and 3 deletions
|
|
@ -1,9 +1,24 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
|
||||
let cfg = config.targets.darwin;
|
||||
in {
|
||||
options.targets.darwin.linkApps = {
|
||||
enable =
|
||||
lib.mkEnableOption "linking macOS applications to the user environment"
|
||||
// {
|
||||
default = true;
|
||||
};
|
||||
|
||||
directory = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "Applications/Home Manager Apps";
|
||||
description = "Path to link apps relative to the home directory.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (pkgs.stdenv.hostPlatform.isDarwin && cfg.linkApps.enable) {
|
||||
# Install MacOS applications to the user environment.
|
||||
home.file."Applications/Home Manager Apps".source = let
|
||||
home.file.${cfg.linkApps.directory}.source = let
|
||||
apps = pkgs.buildEnv {
|
||||
name = "home-manager-applications";
|
||||
paths = config.home.packages;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue