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.
This commit is contained in:
John Titor 2024-03-25 16:27:09 +05:30
parent 5c9bfde33c
commit 888accda88
No known key found for this signature in database
GPG Key ID: 29B0514F4E3C1CC0
1 changed files with 15 additions and 0 deletions

View File

@ -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; [