helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.8k stars 2.51k forks source link

Permission denied on nix #11985

Open noahfraiture opened 2 weeks ago

noahfraiture commented 2 weeks ago

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

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 (079f5442)

TornaxO7 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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

noahfraiture commented 2 weeks ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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