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

Permission denied on nix #11985

Open
noahfraiture opened this issue Nov 2, 2024 · 8 comments
Open

Permission denied on nix #11985

noahfraiture opened this issue Nov 2, 2024 · 8 comments
Labels
C-bug Category: This is a bug

Comments

@noahfraiture
Copy link

Summary

Hello,
My problem is the following : helix need sudo access for any file, even wihout a file.
I'm on nixos and I declare my helix configuration through home-manager which create readonly configuration. On a fresh system there's no problem, but after a while, I can't use helix anymore without sudo.
I think the problem might come from readonly log. If I sudo chmod a+w ~/.cache/helix/helix.log, it works well, until nixos rebuild this file itself.
I think nixos or home-manager shouldn't touch this file ever to avoid this situation

Reproduction Steps

  • Install helix through home-manager
  • Use it and rebuild more than once
  • problem

Helix log

There's nothing on the log, the access to the log is the problem

Platform

Linux

Terminal Emulator

Kitty

Installation Method

home-manager from nix

Helix Version

helix 24.7 (079f544)

@noahfraiture noahfraiture added the C-bug Category: This is a bug label Nov 2, 2024
@TornaxO7
Copy link
Contributor

TornaxO7 commented Nov 2, 2024

You can create an alias where the helix is writing to /dev/null: hx --log /dev/null.

However

I'm on nixos and I declare my helix configuration through home-manager which create readonly configuration.

this doesn't sound right. I'm using helix with home-manager as well but I don't get this problem. May I ask if you could post your relevant NixOS/home-manager config here please?

@noahfraiture
Copy link
Author

You can create an alias where the helix is writing to /dev/null: hx --log /dev/null.

That's a good work around already

{ pkgs, config, ... }:

{
  stylix.targets.helix.enable = false;

  programs.helix = {
    enable = true;
    defaultEditor = true;

    settings = {
[...]
    }
home.packages = [ pkgs.helix, ... ];
}

@TornaxO7
Copy link
Contributor

TornaxO7 commented Nov 2, 2024

Hm... well that's weird that ~/.cache is just readable for you.
Maybe some other setting in your nix-config is setting this?

@noahfraiture
Copy link
Author

Hm... well that's weird that ~/.cache is just readable for you. Maybe some other setting in your nix-config is setting this?

I have two options related to cache but I don't see how it can interfere. The first one being : home.file.".cache/ags/hyprpanel/options.json" = { used to configure hyprpanel. And the second one being programs.man.generateCaches = true; for man page with nushell

@ixxie
Copy link

ixxie commented Nov 3, 2024

Can you share the relevant parts of your configuration? I'm running Helix on NixOS with home-manager and don't have any issues.

@noahfraiture
Copy link
Author

Can you share the relevant parts of your configuration? I'm running Helix on NixOS with home-manager and don't have any issues.

There's nothing more than what I posted above, so this :

{ pkgs, config, ... }:

{
  stylix.targets.helix.enable = false;

  programs.helix = {
    enable = true;
    defaultEditor = true;

    settings = {

      theme = "stylix";

...

  home.packages = with pkgs; [
    helix
...
}

@ixxie
Copy link

ixxie commented Nov 3, 2024

I think you don't have to add helix to your packages when you set programs.helix.enable to true (I don't and it works).

I don't use stylix; have you tried disabling that?

@noahfraiture
Copy link
Author

I think you don't have to add helix to your packages when you set programs.helix.enable to true (I don't and it works).

I don't use stylix; have you tried disabling that?

Stylix shouldn't do anything, especially if disabled. It's pretty hard to remove since there's a lot of packages depending on it.
I will try to remove programs.helix.enable.
A theory I have, is that hyprpanel write its configuratin in ~/.cache (yes, it's very stupid), and thus make the whole directory in read-only. I will try to remove that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants