Merge pull request #298896 from JohnRTitor/master

nixos/hyprland: Add systemd.setPath.enable option to include system and user bin directory in PATH
This commit is contained in:
Jörg Thalheim 2024-04-07 18:44:47 +02:00 committed by GitHub
commit 1155526bf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 3 deletions

View File

@ -13,7 +13,7 @@ in
{
options.programs.hyprland = {
enable = mkEnableOption null // {
description = mdDoc ''
description = ''
Hyprland, the dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
You can manually launch Hyprland by executing {command}`Hyprland` on a TTY.
@ -33,14 +33,24 @@ in
};
defaultText = literalExpression
"`programs.hyprland.package` with applied configuration";
description = mdDoc ''
description = ''
The Hyprland package after applying configuration.
'';
};
portalPackage = mkPackageOption pkgs "xdg-desktop-portal-hyprland" { };
xwayland.enable = mkEnableOption (mdDoc "XWayland") // { default = true; };
xwayland.enable = mkEnableOption ("XWayland") // { default = true; };
systemd.setPath.enable = mkEnableOption null // {
default = true;
example = false;
description = ''
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 +73,12 @@ in
extraPortals = [ finalPortalPackage ];
configPackages = mkDefault [ cfg.finalPackage ];
};
systemd = mkIf cfg.systemd.setPath.enable {
user.extraConfig = ''
DefaultEnvironment="PATH=$PATH:/run/current-system/sw/bin:/etc/profiles/per-user/$USER/bin:/run/wrappers/bin"
'';
};
};
imports = with lib; [