Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid cross-device link #17

Open
michaelmesser opened this issue Sep 4, 2020 · 8 comments
Open

Invalid cross-device link #17

michaelmesser opened this issue Sep 4, 2020 · 8 comments

Comments

@michaelmesser
Copy link

michaelmesser commented Sep 4, 2020

> mkdir -m 0755 ~/private/.nix
> ./private/nix-user-chroot ~/private/.nix bash -c "curl -L https://nixos.org/nix/install | bash"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  2490  100  2490    0     0  11690      0 --:--:-- --:--:-- --:--:-- 11690
downloading Nix 2.3.7 binary tarball for x86_64-linux from 'https://releases.nixos.org/nix/nix-2.3.7/nix-2.3.7-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.qU8sjaLWPz'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16.4M  100 16.4M    0     0  8935k      0  0:00:01  0:00:01 --:--:-- 8930k
Note: a multi-user installation is possible. See https://nixos.org/nix/manual/#sect-multi-user-installation
performing a single-user installation of Nix...
copying Nix to /nix/store......................................
installing 'nix-2.3.7'
error: linking '/nix/store/b64sdzfcc4wd2p656i9jskxdmhjkq0cv-user-environment.drv.chroot/nix/store/p8ij3l24f23kzcmfk1qd5kyzr4rp54w8-env-manifest.nix' to '/nix/store/p8ij3l24f23kzcmfk1qd5kyzr4rp54w8-env-manifest.nix': Invalid cross-device link

I'm not sure what /nix/store/b64sdzfcc4wd2p656i9jskxdmhjkq0cv-user-environment.drv.chroot/ is because it does not appear to exist

@Mic92
Copy link
Member

Mic92 commented Sep 6, 2020

@michaelmesser
Copy link
Author

@Mic92 Is it supposed to be a directory?

@Mic92
Copy link
Member

Mic92 commented Sep 6, 2020

@Mic92 Is it supposed to be a directory?

It is created by nix during the build I think.

@michaelmesser
Copy link
Author

The solution was to disable sandboxing by writing sandbox = false to /nix/etc/nix/nix.conf before installing nix

@Mic92
Copy link
Member

Mic92 commented Sep 9, 2020

Ok. Maybe we should mention that in our installation guide:

export NIX_CONF_DIR=some-alternative-dir

should also work to provide a different configuration during installation.

@KornelJahn
Copy link

This error also occurs during NixOS installation, when a script created using pkgs.writeShellApplication fails the shellcheck step. See MWE here.

@Mikilio
Copy link

Mikilio commented Jul 5, 2023

The same error occurred for me when installing NixOS with configuration for kmonad NixOSmodule. It seemed to have an issue linking my .kbd file. So it's not only the SpellCheck that causes this.

@KornelJahn
Copy link

The same error occurred for me when installing NixOS with configuration for kmonad NixOSmodule. It seemed to have an issue linking my .kbd file. So it's not only the SpellCheck that causes this.

You are right, I've also experienced it occasionally with other packages during NixOS installation. It seems that this "Invalid cross-device link" error usually masks the root cause, which can, however, be found out when only building the system config via
nix build <flake-path>#nixosConfigurations.<hostname>.config.system.build.toplevel
(when using Flakes and the new Nix command).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants