mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-31 04:04:32 +00:00
Merge 5531b3f74b
into 94605dcade
This commit is contained in:
commit
75c000ff56
3 changed files with 25 additions and 10 deletions
|
@ -495,6 +495,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
home.buildEnvWithNoChroot = lib.mkEnableOption ''
|
||||
Sets <code>__noChroot = true</code> on select <code>buildEnv</code>
|
||||
derivations that assemble large numbers of paths, as well the activation
|
||||
script derivations. This may be used to avoid sandbox failures on Darwin,
|
||||
see https://github.com/NixOS/nix/issues/4119 and the <code>sandbox</code>
|
||||
option in <command>man nix.conf</command>.
|
||||
'';
|
||||
|
||||
home.preferXdgDirectories = lib.mkEnableOption "" // {
|
||||
description = ''
|
||||
Whether to make programs use XDG directories whenever supported.
|
||||
|
@ -737,7 +745,7 @@ in
|
|||
)
|
||||
+ lib.optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
||||
|
||||
activationScript = pkgs.writeShellScript "activation-script" ''
|
||||
activationScript = (pkgs.writeShellScript "activation-script" ''
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
|
@ -767,9 +775,11 @@ in
|
|||
run rm $VERBOSE_ARG "$legacyGenGcPath"
|
||||
fi
|
||||
''}
|
||||
'';
|
||||
'').overrideAttrs (old: {
|
||||
__noChroot = cfg.buildEnvWithNoChroot;
|
||||
});
|
||||
in
|
||||
pkgs.runCommand
|
||||
(pkgs.runCommand
|
||||
"home-manager-generation"
|
||||
{
|
||||
preferLocalBuild = true;
|
||||
|
@ -791,9 +801,11 @@ in
|
|||
ln -s ${cfg.path} $out/home-path
|
||||
|
||||
${cfg.extraBuilderCommands}
|
||||
'';
|
||||
'').overrideAttrs (old: {
|
||||
__noChroot = cfg.buildEnvWithNoChroot;
|
||||
});
|
||||
|
||||
home.path = pkgs.buildEnv {
|
||||
home.path = (pkgs.buildEnv {
|
||||
name = "home-manager-path";
|
||||
|
||||
paths = cfg.packages;
|
||||
|
@ -804,6 +816,8 @@ in
|
|||
meta = {
|
||||
description = "Environment of packages installed through home-manager";
|
||||
};
|
||||
};
|
||||
}).overrideAttrs (old: {
|
||||
__noChroot = cfg.buildEnvWithNoChroot;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
let
|
||||
homeDir = config.home.homeDirectory;
|
||||
fontsEnv = pkgs.buildEnv {
|
||||
fontsEnv = (pkgs.buildEnv {
|
||||
name = "home-manager-fonts";
|
||||
paths = config.home.packages;
|
||||
pathsToLink = "/share/fonts";
|
||||
};
|
||||
}).overrideAttrs (old: { __noChroot = config.home.buildEnvWithNoChroot; });
|
||||
fonts = "${fontsEnv}/share/fonts";
|
||||
installDir = "${homeDir}/Library/Fonts/HomeManager";
|
||||
in {
|
||||
|
|
|
@ -19,11 +19,12 @@ in {
|
|||
config = lib.mkIf (pkgs.stdenv.hostPlatform.isDarwin && cfg.linkApps.enable) {
|
||||
# Install MacOS applications to the user environment.
|
||||
home.file.${cfg.linkApps.directory}.source = let
|
||||
apps = pkgs.buildEnv {
|
||||
apps = (pkgs.buildEnv {
|
||||
name = "home-manager-applications";
|
||||
paths = config.home.packages;
|
||||
pathsToLink = "/Applications";
|
||||
};
|
||||
}).overrideAttrs
|
||||
(old: { __noChroot = config.home.buildEnvWithNoChroot; });
|
||||
in "${apps}/Applications";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue