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

bug: mkdir fails with 'Operation not permitted' for some pkgs during installPhase #6532

Open
2 tasks done
MSDimos opened this issue Feb 26, 2025 · 0 comments
Open
2 tasks done
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@MSDimos
Copy link

MSDimos commented Feb 26, 2025

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

What happened to me?

I can't switch home-manager generation anymore.

I use home-manager to install vscode like home.packages = [ pkgs.vscode ];, a day before, it works fine, but today everything is broken.

My command's execution result:

$ nix run home-manager/master -- switch --flake .--impure
/* some log msg not important */
error: builder for '/nix/store/qlzsz9j20dgv4mw778gjpg6rbr9ad9ml-vscode-1.97.2.drv' failed with exit code 1;
       last 9 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/7rki4hbfvg9z1c1pcq30mlcj0yihkaw6-VSCode_1.97.2_darwin-arm64.zip
       > source root is Visual Studio Code.app
       > setting SOURCE_DATE_EPOCH to timestamp 1739435512 of file "Visual
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: glibPreInstallPhase
       > Running phase: installPhase
       > mkdir: cannot create directory '/nix/store/y4xz7f5qwnamnlwcn6jydds71c1r99va-vscode-1.97.2/Applications/Visual Studio Code.app': Operation not permitted
       For full logs, run:
         nix log /nix/store/qlzsz9j20dgv4mw778gjpg6rbr9ad9ml-vscode-1.97.2.drv
error: 1 dependencies of derivation '/nix/store/2q1mcszy8yy4xi898267855j69yvhi5f-home-manager-applications.drv' failed to build
error: 1 dependencies of derivation '/nix/store/83kxjvjj3aznrjx66gz3qpw7wx5k3wla-home-manager-fonts.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4wgf51r2mw6mr6jsi6piqdd7f86lcpw9-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8lcmwjjjm7pgih0m5qh0iqg3jpsvbdwr-home-manager-generation.drv' failed to build

I have checked the permission of related directories, like below:

$ ls -la /nix/store/ -g | grep "vscode-1.97.2"
drwxr-xr-x      - _nixbld1 nixbld  2 Feb 13:35  y4xz7f5qwnamnlwcn6jydds71c1r99va-vscode-1.97.2

What did I do before?

I uninstalled the nix followed by this tutorial and reinstall it using nix-installer.

Something weired

I googled this same issue, but this unlucky guy like me is using nix-darwin. I followed what they did like:

home.packages = [
  vscode = pkgs.vscode.overrideAttrs (old: {
    installPhase = "whoami\n" + old.installPhase;
  });
];

It's okay now. But I can't understand it.

Maintainer CC

No response

System information

- system: `"aarch64-darwin"`
 - host os: `Darwin 24.4.0, macOS 15.4`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.26.2`
 - nixpkgs: `/nix/store/4yng3wz3ri8q2g64aysa72j1n3dsa0i2-source`
@MSDimos MSDimos added bug triage Issues or feature request that have not been triaged yet labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

4 participants