Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/hyprland: Add systemd.setPath.enable option to include system and user bin directory in PATH #298896

Merged
merged 3 commits into from Apr 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 19 additions & 3 deletions nixos/modules/programs/wayland/hyprland.nix
Expand Up @@ -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.
Expand All @@ -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 {
Expand All @@ -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; [
Expand Down