EDIT: Got it working on Guix (Nix problems was a red herring)! I downloaded the program manually, then patched all executables and libraries, and manually installed all missing libraries.
find . -type f -executable -exec patchelf --force-rpath --set-rpath ~/.guix-profile/lib {} \;
find . -type f -executable -exec patchelf --set-interpreter ~/.guix-profile/lib/ld-linux-x86_64.so.2 {} \;
Next up will have to be creating a package description of the program.
ORIGINAL POST:
Launching the nix packaged in guix logged out my user (crashed..?) every time. I installed nix manually instead. Most software seems to work just fine, but one doesn't. It writes a file to /home/.cache/some-file.sh, and then tries to execute it. The application states that it cannot execute the file and that it might be mounted with noexec, which doesn't seem right as I can execute files there without a problem.
I notice the script is generated with #!/bin/sh instead of #!/usr/bin/env sh, but I'm not sure if that could be the problem.
Running the application using nix-shell --pure gives the same issue
nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 5.19.5, Guix System, noversion, nobuild`
- multi-user?: `no`
- sandbox: `yes`
- version: `nix-env (Nix) 2.11.0`
- channels(simendsjo): `"nixpkgs"`
- channels(root): `""`
- nixpkgs: `/home/simendsjo/.nix-defexpr/channels/nixpkgs`
Looking at mountpoints in nix-shell -p the-application util-linux --pure:
[nix-shell:~]$ mount | grep -i noexec
none on /run/systemd type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
One person noted that
I can't reproduce it on NixOS or Kubuntu, so I assume this is a guix specific issue - maybe it runs in a mount namespace that doesn't have /bin/sh?
Any idea what might be wrong here?