nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.16k stars 1.85k forks source link

bug: neovim not being in the path of foot-server service #5996

Open sachinchaudhary1808 opened 1 month ago

sachinchaudhary1808 commented 1 month ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

https://codeberg.org/dnkl/foot/issues/1844#issuecomment-2397192

Maintainer CC

No response

System information

~ via 🌙 
❯ nix-shell -p nix-info --run "nix-info -m"
fetching path input 'path:/nix/store/riqkpszjqk02bi1wppfg8ip5xvh102qd-source'
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.57, NixOS, 24.11 (Vicuna), 24.11.20241018.4c2fcb0`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.91.0
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/coco/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/coco/.local/share/flatpak/exports/etc/xdg/nix/nix.conf:/var/lib/flatpak/exports/etc/xdg/nix/nix.conf:/home/coco/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/coco/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/coco/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/g839w7gjl0v4vc1gc9gd80ns57hb2kgm-lix-2.91.0/share`
 - nixpkgs: `/nix/store/riqkpszjqk02bi1wppfg8ip5xvh102qd-source`
sachinchaudhary1808 commented 1 month ago

my foot config https://github.com/sachinchaudhary1808/nixos-dotfiles/blob/main/modules/gui/foot.nix

rycee commented 1 month ago

Sorry, don't know much about either foot service or neovim. Perhaps @plabadens can help?

When you open a foot window, what does echo $PATH say?

sachinchaudhary1808 commented 1 month ago

Sorry, don't know much about either foot service or neovim. Perhaps @plabadens can help?

When you open a foot window, what does echo $PATH say?

echo $PATH /run/wrappers/bin:/home/coco/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/home/coco/.nix-profile/bin:/nix/profile/bin:/home/coco/.local/state/nix/profile/bin:/etc/profiles/per-user/coco/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin

i don't know if path is the issue but when i do foot -e nvim when server is running it just dosen't show me anything but when i open footclient and run nvim then it works

sachinchaudhary1808 commented 1 month ago

https://github.com/user-attachments/assets/ac462629-0797-495c-9e21-15ab9564d7bc

look at this

sachinchaudhary1808 commented 1 month ago

to be sure it's a home-manager issue i tried comment the server.enable = true line in config and started foot --server on my sway config and things just work fine

sachinchaudhary1808 commented 1 month ago

and only something sap-rate related to this, that i had to remove dead code related to foot service cuz of it was not working, i guess foot module really needs some upgrade here

plabadens commented 4 weeks ago

The reason this happens is that, by default, any new instances of footclient will run within the environment of the server (see under -E in https://man.archlinux.org/man/extra/foot/footclient.1.en). The server runs through a systemd user service, and does not have access to your entire path. There are two approaches to solve this:

  1. Import your PATH into the systemd user environment. Something like systemctl --user import-environment as part of your session setup (maybe WM config?) should do the trick.
  2. Run footclient with -E, so that it uses the environment of the client instead of the server.

I don't believe that this is an issue with home-manager itself, as it's one of the caveats of using foot in client-server mode.

sachinchaudhary1808 commented 3 weeks ago
  1. systemctl --user import-environment

also i get this

❯ systemctl --user import-environment Calling import-environment without a list of variable names is deprecated.

also this doesn't do any trick maybe some errors i have

exec systemctl --user import-environment

this in my config file

also doing like

exec systemctl --user import-environment PATH

does nothing too