Failed to install Nix in iSH, iOS

System: i686-linux
host os: Linux 4.20.69-ish iSH 1.2.3 (298) i686 Linux
shell: bash 5.1.16

I am executing:

    $ sudo /nix/store/acghbpn3aaj2q64mz3ljipsgf9d9qxlp-nix-2.11.1/bin/nix-store --load-db

to load data for the first time in to the Nix Database

/nix/store/acghbpn3aaj2q64mz3ljipsgf9d9qxlp-nix-2.11.1/bin/nix-store: error while loading shared libraries: libsodium.so.23: cannot stat shared object: No such file or directory

3 Likes

Nix on my phone? I had to check this out!
I got the same error, decided to see what happens.

~# ldd /nix/store/nd4d8pqaq9mdr50gfxrs3b52k7s3zwld-libsodium-1.0.18/lib/libsodium.so.23
        /lib/ld-musl-i386.so.1 (0xf7f66000)
        libpthread.so.0 => /lib/ld-musl-i386.so.1 (0xf7f66000)
        libc.so.6 => /lib/ld-musl-i386.so.1 (0xf7f66000)
        ld-linux.so.2 => /nix/store/n7r6ynq8mcr9wphb0yb1frrxr2yp78bg-glibc-2.34-210/lib/ld-linux.so.2 (0xf7ebc000)
Error relocating /nix/store/n7r6ynq8mcr9wphb0yb1frrxr2yp78bg-glibc-2.34-210/lib/ld-linux.so.2: unsupported relocation type 42
Error relocating /nix/store/nd4d8pqaq9mdr50gfxrs3b52k7s3zwld-libsodium-1.0.18/lib/libsodium.so.23: __memcpy_chk: symbol not found
Error relocating /nix/store/nd4d8pqaq9mdr50gfxrs3b52k7s3zwld-libsodium-1.0.18/lib/libsodium.so.23: __explicit_bzero_chk: symbol not found

It looks like musl linker that is used by Alpine in this VM can’t handle glibc symbols or something.
I’d recommend trying Nix compiled with musl somehow.

Guys I got nix successfully installed! Nix is offered as a package in the edge repository (the unstable).

My steps:

  • delete /ish folder to prevent ish overwrite /etc/apk/repositories (this behavior is written in the comment in the file)
  • change url in /etc/apk/repositories into edge:
http://dl-3.alpinelinux.org/alpine/edge/main
http://dl-3.alpinelinux.org/alpine/edge/community 

I tried the deterministic nix installer run and into error, the official one cause ish crash.

Looks like Nix doesn’t work in that environment anymore. With 2.22.0-r0 version from Alpine I get following error when running any Nix command:

terminate called after throwing an instance of 'nix::SysError'
  what():  error: saving parent mount namespace: No such file or directory
Aborted

I guess, something changed since 2.20.5, but I don’t see what: Comparing 2.20.5..2.22.0 · NixOS/nix · GitHub - it has always called saveMountNamespace there…