nix-community / nix-on-droid

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

Cannot update flake inputs #313

Open matt1432 opened 6 months ago

matt1432 commented 6 months ago

Whenever I try to do nix flake update or nix-on-droid switch I get this weird error. I have my NixOS and nix-on-droid configs in the same repo and it stopped working at this commit

$ nix-on-droid switch --flake ~/.nix
Building activation package...
error:
       … while fetching the input 'git+file:///data/data/com.termux.nix/files/home/.nix'

       error: cannot link '/nix/store/.links/1isr4xv4akzdabjak4z4wlfcnzbn8kk924chbb3vdm6fy20yyvf2' to '/nix/store/1z7g3yq059v70sbrf2plmc7h96cfzdbb-source/.gitignore': Operation not permitted
Gerschtli commented 6 months ago

https://git.nelim.org/matt1432/nixos-configs/src/commit/ff1002c97055d19fc13902145a854c77332d625d/common/nix-on-droid.nix#L20

Nix store optimise is sometimes causing problems because of the created hardlinks. You probably need to reset nix-on-droid completely to fix this..

matt1432 commented 6 months ago

@Gerschtli Thank you! That was indeed my issue. Is this mentionned anywhere?

I haven't seen that problem anywhere so it would be nice to have it documented before closing this issue.

ErrorNoInternet commented 4 months ago

Temporarily fixed this without resetting by passing --option auto-optimise-store false when building and manually modifying the activate script (specifically the nix-env command during the installPackages phase) to also turn off auto-optimise-store.