NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.4k stars 12.9k forks source link

Hyprland: Order of PATH Environment Variable is incorrect for user services #320734

Closed Reputable2772 closed 3 days ago

Reputable2772 commented 1 week ago

Describe the bug

In the file, nixos/modules/programs/wayland/hyprland.nix, the priority for the PATH is set incorrectly with /run/wrappers/bin at the end. This causes permission issues with systemd services.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create a systemd user service, which uses any file in /run/wrappers/bin in the Exec= line.
  2. Run the systemd service.

Expected behavior

Permissions errors should not have occurred with the systemd service.

Additional context

Current workaround.

programs.hyprland.systemd.setPath.enable = false;
systemd.user.extraConfig = ''
  DefaultEnvironment="PATH=/run/wrappers/bin:/etc/profiles/per-user/%u/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:$PATH"
'';

Notify maintainers

@fufexan

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.3-zen1, NixOS, 24.11 (Vicuña), 24.11.20240612.57d6973`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.22.1`
 - nixpkgs: `/nix/store/dydg48djlykksz8cxq0xjplyxpa9pvf4-source`

Add a :+1: reaction to issues you find important.