nix-community / nix-on-droid

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

flake.nix: expose `nix-on-droid` package in overlay #388

Closed pinage404 closed 1 month ago

t184256 commented 3 months ago

what's the point of that? what usage does it help with?

pinage404 commented 3 months ago

When using the nix-on-droid's overlay like in the advanced template

https://github.com/nix-community/nix-on-droid/blob/8bcadcef69dcb5ca177bfb6ea3dc6b092cda2b06/templates/advanced/flake.nix#L43

It allows to install the package with a normal pkgs.nix-on-droid instead of inputs.nix-on-droid.packages."${system}".nix-on-droid

t184256 commented 3 months ago

but it is installed by default... I don't get it

pinage404 commented 3 months ago

it can be usefull if we want to use nix-on-droid on another platform

i'm trying to write a deployment script, i use it

t184256 commented 3 months ago
  1. why use that imperative tool from another platform; it's meant to be run on the target device
  2. in this case, accessing it from an overlay only makes it harder, doesn't it?
pinage404 commented 3 months ago
  1. my computer is more powerful than my phone, i would like to build on my computer (and check if all is good) instead of pushing, on my phone waiting the long evalution, then see that it fails after a long delay
  2. i prefer to add the overlay in one place than writing inputs.nix-on-droid.packages."${system}".nix-on-droid everywhere i need nix-on-droid
t184256 commented 3 months ago

sorry, good, but where do you need it at all? how many places is that, what are they?

pinage404 commented 3 months ago

i haven't finished my script (the feedback loop is super long) for the moment, i need it in 2 places

If you believe, that is not a good thing, i can close this PR

t184256 commented 3 months ago

I don't know, I need to weigh pros and cons of exposing it this way. Once I do that, it'd be hard to remove it back + I'm not sure what's the behaviour of overriding it in an overlay is etc. etc. Not something I can decide on quickly.

shelvacu commented 3 months ago

my computer is more powerful than my phone, i would like to build on my computer (and check if all is good)

FYI @pinage404 if you use flakes you can build on your computer with nix build .#nixOnDroidConfigurations.default.activationPackage --impure

pinage404 commented 3 months ago

the current WIP (that doesn't work) https://gitlab.com/pinage404/dotfiles/-/blob/c32e3c71a5662228c30faf4e528354efa8d02843/packages/deploy-fairphone_4/default.nix

why --impure is needed ?

t184256 commented 3 months ago

On July 16, 2024 12:10:53 AM GMT+03:00, pinage404 @.***> wrote:

the current WIP (that doesn't work) https://gitlab.com/pinage404/dotfiles/-/blob/c32e3c71a5662228c30faf4e528354efa8d02843/packages/deploy-fairphone_4/default.nix

why --impure is needed ?

Because cross-compiled proot is injected by hash.

pinage404 commented 1 month ago

I understand

Should we close this ?

shelvacu commented 1 month ago

yes