home-manager
home-manager copied to clipboard
bug: mv: inter-device move failed: '/tmp/nix-build-emacs.service.drv-0/.attr-1' to "/nix/store/xyz-emacs.service'/emacs.service'"; unable to remove target: Permission denied
Are you following the right branch?
- [X] My Nixpkgs and Home Manager versions are in sync
Is there an existing issue for this?
- [X] I have searched the existing issues
Issue description
When building service files I get the above error.
I believe this is because on this machine /tmp is mounted on a different drive than /nix/store (not tmpfs) and home-manager uses writeTextFile to write systemd unit files: https://github.com/nix-community/home-manager/blob/9f7fe353b613d0e45d7a5cdbd1f13c96c15803dd/modules/systemd.nix#L41
... which, in turn, uses mv:
https://github.com/NixOS/nixpkgs/blob/2eb8607fd30f53c25dce32de0b17ce3fb6ab2007/pkgs/build-support/trivial-builders.nix#L128
nixpkgs uses runCommand to write units: https://github.com/NixOS/nixpkgs/blob/ea3f05e3e3fb5eaf6309deb443a1200f6389ae8a/nixos/lib/systemd-lib.nix#L20
Maintainer CC
No response
System information
(sensitive information elided, no channels were used for this error to occur)
- system: `"x86_64-linux"`
- host os: `Linux 5.4.122, NixOS, 20.09pre-git (Nightingale)`
- multi-user?: `no`
- sandbox: `no`
- version: `nix-env (Nix) 2.3.11`
This seems to have actually been fixed some time recently. Simply bumping home-manager seems to have helped.
is hte linked PR still needed then ? shall we close ?
Yeah. Closing since this is fixed. Thank you!