nix-on-droid icon indicating copy to clipboard operation
nix-on-droid copied to clipboard

Cannot update flake inputs

Open matt1432 opened this issue 1 year ago • 3 comments

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

matt1432 avatar Dec 11 '23 20:12 matt1432

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..

Gerschtli avatar Dec 12 '23 13:12 Gerschtli

@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.

matt1432 avatar Dec 12 '23 15:12 matt1432

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.

ErrorNoInternet avatar Mar 06 '24 10:03 ErrorNoInternet