nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.55k stars 1.73k forks source link

Support nix-on-droid #848

Closed Gerschtli closed 4 years ago

Gerschtli commented 4 years ago

Hello,

I currently diving deep into home-manager and nix-on-droid. To improve the workflow and maintainability I suggested in issue https://github.com/t184256/nix-on-droid-bootstrap/issues/10 to create a separate home-manager module for managing some static files and symlinks all over the place.

Just a brief overview of the file structure ($PREFIX/usr is available under / via proot):

I would like to augment the functionality of the files module to be able to manage the files in $PREFIX/usr via home-manager. What do you think? Is this a way to go or do you have other ideas?

I'm not sure if I should set the new extended API of the files module to public as this could easily misused. On the other hand this could come in handy for more configurations needed for nix-on-droid..

t184256 commented 4 years ago

$PREFIX/usr is available under / via proot

For correctness sake, this is not entirely true. /nix, /bin, /etc, /tmp and /usr are proot-pseudo-mounted from /data/data/com.termux.nix/files/usr, but the rest of / comes as-is from the outer Android, notably /sdcard.

rycee commented 4 years ago

Well, currently HM is semi-artificially limited to managing files in $HOME. I believe it could relatively easily be made to manage files anywhere using home.file."/absolute/path/to/file".(source|text) assuming the HM user is having write permission for the target paths.