mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
environment.path: fix installation with nix profile
Manual removal and installation as two non-atomical steps is required because of https://github.com/NixOS/nix/issues/6349.
This commit is contained in:
parent
27c206f57a
commit
048b22fe13
1 changed files with 13 additions and 1 deletions
|
|
@ -38,7 +38,19 @@ in
|
|||
|
||||
build.activation.installPackages = ''
|
||||
if [[ -e "${config.user.home}/.nix-profile/manifest.json" ]]; then
|
||||
$DRY_RUN_CMD nix profile install ${cfg.path}
|
||||
# manual removal and installation as two non-atomical steps is required
|
||||
# because of https://github.com/NixOS/nix/issues/6349
|
||||
|
||||
nix_previous="$(command -v nix)"
|
||||
|
||||
nix profile list \
|
||||
| grep 'nix-on-droid-path$' \
|
||||
| cut -d ' ' -f 4 \
|
||||
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
|
||||
|
||||
$DRY_RUN_CMD $nix_previous profile install ${cfg.path}
|
||||
|
||||
unset nix_previous
|
||||
else
|
||||
$DRY_RUN_CMD nix-env --install ${cfg.path}
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue