mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01:00
targets/darwin: allow configuring application linking
This commit is contained in:
parent
a2523ea034
commit
259f39246d
1 changed files with 23 additions and 3 deletions
|
@ -1,9 +1,29 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
|
||||
with lib;
|
||||
|
||||
let cfg = config.targets.darwin;
|
||||
in {
|
||||
options.targets.darwin.linkApps = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
example = false;
|
||||
description =
|
||||
"Whether to enable linking macOS applications to the user environment.";
|
||||
};
|
||||
|
||||
directory = mkOption {
|
||||
type = types.str;
|
||||
default = "Applications/Home Manager Apps";
|
||||
defaultText = "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…
Reference in a new issue