From 888accda88df3e66ecc79d08d9fbd495200f5228 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:27:09 +0530 Subject: [PATCH] nixos/hyprland: add systemd.setPath.enable option This commit adds systemd.setPath.enable option to hyprland module which sets the systemd path to include the current system's bin This is needed in Hyprland only setups, where opening links in applications like VS code do not work. --- nixos/modules/programs/wayland/hyprland.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nixos/modules/programs/wayland/hyprland.nix b/nixos/modules/programs/wayland/hyprland.nix index 9061ce5da83a..86f8b570f920 100644 --- a/nixos/modules/programs/wayland/hyprland.nix +++ b/nixos/modules/programs/wayland/hyprland.nix @@ -41,6 +41,15 @@ in portalPackage = mkPackageOption pkgs "xdg-desktop-portal-hyprland" { }; xwayland.enable = mkEnableOption (mdDoc "XWayland") // { default = true; }; + + systemd.setPath.enable = mkEnableOption null // { + default = true; + description = mdDoc '' + Set environment path of systemd to include the current system's bin directory. + This is needed in Hyprland setups, where opening links in applications do not work. + Enabled by default. + ''; + }; }; config = mkIf cfg.enable { @@ -63,6 +72,12 @@ in extraPortals = [ finalPortalPackage ]; configPackages = mkDefault [ cfg.finalPackage ]; }; + + systemd = mkIf cfg.systemd.setPath.enable { + user.extraConfig = '' + DefaultEnvironment="PATH=$PATH:/run/current-system/sw/bin" + ''; + }; }; imports = with lib; [