nix-community / nix-on-droid

Nix-enabled environment for your Android device. [maintainers=@t184256,@Gerschtli]
https://nix-on-droid.unboiled.info
MIT License
1.29k stars 72 forks source link

environment.path: fix installation with nix profile #223

Closed Gerschtli closed 1 year ago

Gerschtli commented 1 year ago

Manual removal and installation as two non-atomical steps is required because of https://github.com/NixOS/nix/issues/6349.

Related https://github.com/nix-community/home-manager/pull/3367

t184256 commented 1 year ago

Wait, so, it used to accumulate packages before without removing? Or am I misunderstanding something? Do we want a test for this?

Gerschtli commented 1 year ago

In case of no flake input/channel updates, yes. In case of updates, the activation would have failed because there would have been an error like "/bin/abc is already installed, not able to install it in the profile" like shown in the related HM issue.

Sure, good idea, will add a test.

Gerschtli commented 1 year ago

Regarding the test: Not sure how to do this properly because this means I need to convert the default profile to "nix profile"-type and can not really roll it back to "nix-env"-type

error: profile '/nix/var/nix/profiles/per-user/nix-on-droid/profile' is incompatible with 'nix-env'; please use 'nix profile' instead

So we can either test nix-env or nix profile activation logic but not both. Maybe we need to rethink our tests a little bit, also with the fact that they require a channel-setup and don't work with flakes..

Gerschtli commented 1 year ago

@t184256 How do we want to go on here? I think it would be great to have this fix before creating 21.11 release.

Do you have suggestions how to write a test for that?

t184256 commented 1 year ago

As "rethink our tests to nuke environment in between them" sounds overly grandiose, maybe we can merge that with just the manual testing.

Gerschtli commented 1 year ago

Created https://github.com/t184256/nix-on-droid/issues/233 to don't forget it.

I tested it manually on device.