mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-15 05:21:06 +01:00
home-manager: improve nix profile detection
If `nix.settings.use-xdg-base-directories` is true, the `~/.nix-profile` directory may not exist, and `home.profileDirectory` should be checked instead. Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
This commit is contained in:
parent
e9b9ecef42
commit
a2e592cc49
2 changed files with 10 additions and 4 deletions
|
|
@ -175,7 +175,7 @@ in
|
|||
done automatically if the shell configuration is managed by Home
|
||||
Manager. If not, then you must source the
|
||||
|
||||
~/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
${cfg.profileDirectory}/etc/profile.d/hm-session-vars.sh
|
||||
|
||||
file yourself.
|
||||
'')
|
||||
|
|
@ -585,7 +585,7 @@ in
|
|||
if config.submoduleSupport.externalPackageInstall
|
||||
then
|
||||
''
|
||||
if [[ -e $HOME/.nix-profile/manifest.json ]] ; then
|
||||
if [[ -e ${cfg.profileDirectory}/manifest.json ]] ; then
|
||||
nix profile list \
|
||||
| { grep 'home-manager-path$' || test $? = 1; } \
|
||||
| cut -d ' ' -f 4 \
|
||||
|
|
@ -623,7 +623,7 @@ in
|
|||
$DRY_RUN_CMD $oldNix profile install $1
|
||||
}
|
||||
|
||||
if [[ -e $HOME/.nix-profile/manifest.json ]] ; then
|
||||
if [[ -e ${cfg.profileDirectory}/manifest.json ]] ; then
|
||||
INSTALL_CMD="nix profile install"
|
||||
INSTALL_CMD_ACTUAL="nixReplaceProfile"
|
||||
LIST_CMD="nix profile list"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue