-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
bug: permission denied when trying to mkOutOfStoreSymlink
#4692
Comments
This might be caused by NixOS/nix#8965, which was first released in Nix 2.19.0. |
I also ran into this issue after upgrading nixpkgs + hm. It's even stranger that I still can't build with nix
as it still throws |
I am also getting this with:
Is there a workaround? |
I am also getting the same issue |
@spector700 not sure if it's the best way, but my work around was:
|
@spector700 My workaround was to remove the @myguidingstar Changing the version of the |
@rvl Thank you that worked |
For anyone not using NixOS, you can install an older version of Nix by using the direct link to the install scripts: But uninstall and reinstalling of Nix is a bit of a hassle, does anyone know of an easier way to switch the |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/home-manager-mkoutofstoresymlink-and-nixunstable/37241/1 |
@Jak-Ch-ll I know of some ways which could work, but can't remember exactly the details of how Best to ask on NixOS Discourse. I created a thread, which is linked above. |
Signed-off-by: Roosembert Palacios <[email protected]>
If you are looking for a workaround for non-NixOS systems, I did the following and it worked for me.
I am not certain that the systemctl steps are necessary, but they won't hurt anything. If anyone tries without those, please report back. After those steps, I was able to use
|
Still working around nix-community/home-manager#4692 & NixOS/nix#9579
I removed my usage of home.activation = {
# This was using .config and mkOuOfStoreSymlink, but it is broken in recent nix
# see https://github.com/nix-community/home-manager/issues/4692
updateLinks = ''
export ROOT="${config.home.homeDirectory}/.config/home-manager/home"
mkdir -p .config/i3
ln -sf "$ROOT/i3config" .config/i3/config
ln -sf "$ROOT/i3status.conf" .i3status.conf
i3-msg restart
mkdir -p .config/mpv/scripts
ln -sf "$ROOT/mpv_sub-cut.lua" .config/mpv/scripts/sub-cut.lua
'';
}; Where This is not perfect (for example, here the |
This is no longer true, |
Nix 1.19.2 fails to build a derivation containing a symlink to store path. ```nix { local ? "/home/rodney/ops/nixpkgs" , pkgs ? import local {} }: rec { direct-symlink = pkgs.runCommand "direct-symlink" {} '' ln -vs ${local}/.version $out ''; indirect-symlink = pkgs.runCommand "indirect-symlink" {} '' ln -vs ${direct-symlink} $out ''; } ``` So we had to comment out the code below: ```nix home.file."home-config" = { target = ".config/home-manager"; source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/src/nix-config"; }; ``` Refs: - nix-community/home-manager#4692 - NixOS/nix#9579 Signed-off-by: Otavio Salvador <[email protected]>
Nix 1.19.2 fails to build a derivation containing a symlink to store path. ```nix { local ? "/home/rodney/ops/nixpkgs" , pkgs ? import local {} }: rec { direct-symlink = pkgs.runCommand "direct-symlink" {} '' ln -vs ${local}/.version $out ''; indirect-symlink = pkgs.runCommand "indirect-symlink" {} '' ln -vs ${direct-symlink} $out ''; } ``` Refs: - nix-community/home-manager#4692 - NixOS/nix#9579 Signed-off-by: Otavio Salvador <[email protected]>
Nix 1.19.2 fails to build a derivation containing a symlink to store path. ```nix { local ? "/home/rodney/ops/nixpkgs" , pkgs ? import local {} }: rec { direct-symlink = pkgs.runCommand "direct-symlink" {} '' ln -vs ${local}/.version $out ''; indirect-symlink = pkgs.runCommand "indirect-symlink" {} '' ln -vs ${direct-symlink} $out ''; } ``` Refs: - nix-community/home-manager#4692 - NixOS/nix#9579 Signed-off-by: Otavio Salvador <[email protected]>
Nix is built from source to work around nix-community/home-manager#4692
This issue is fixed if i build nix from the Means it'd be fixed for anyone using Here's how I got nix to use the most most recent commit from nix.package = pkgs.nixVersions.unstable.overrideAttrs (oldAttrs: {
src = pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nix";
# 2.21-maintenance, basically just want 2.21.3
rev = "60824fa97c588a0faf68ea61260a47e388b0a4e5";
sha256 = "10z/SoidVl9/lh56cMLj7ntJZHtVrumFvmn1YEqXmaM=";
};
}); |
Nix is built from source to work around nix-community/home-manager#4692
I can confirm that there is no issue with nixUnstable i.e, nix 2.22 (maybe 2.21 also as above comment said) |
@idlip I'm still getting the same error on: 2.22.0 and 2.22.1. I installed those with the following commands:
|
This was done manually because of a bug in nix nix-community/home-manager#4692 which is now fixed.
This was done manually because of a bug in nix nix-community/home-manager#4692 which is now fixed.
This issue can be closed I think, given that it was caused by a nix bug, and that there is a new nix release which fixes the bug. |
The latest Nix including the fix (2.22) does not yet become the default |
Recently-released |
Can anybody confirm this is solved? I still have the issue with |
I am hitting this on one machine, while on another it works. Not sure why... |
I have this issue on Ubuntu with a flake-based home-manager setup. Tested with |
following the guide at https://nix.dev/manual/nix/2.24/installation/upgrading worked for me on ubuntu. |
@chaoky Thank you so much for this hint. I wasn't aware of the fact that only updating the version of the |
Are you following the right branch?
Is there an existing issue for this?
Issue description
When trying to build my home-manager configuration, I get:
The corresponding piece of the config that is causing it is:
By the time it errors,
/nix/store/d5w0zqag0v8wkyab59aph7v9ypkr3h6y-hm_nvim
links to the correct directory. It is afterwards at which it errors.I am doing this on a multi-user installation of nix (version 2.19.1) on an Ubuntu 22.04 VM. When I build the configuration on a machine running NixOS with nix (version 2.17.0), it works fine.
Maintainer CC
@rycee
System information
The text was updated successfully, but these errors were encountered: