about summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorJohn Titor <50095635+JohnRTitor@users.noreply.github.com>2024-03-25 16:27:09 +0530
committerJohn Titor <50095635+JohnRTitor@users.noreply.github.com>2024-04-06 02:29:07 +0530
commit888accda88df3e66ecc79d08d9fbd495200f5228 (patch)
treedf5346857b6f0a20a3a81fe117fb1082b822a970 /nixos/modules/programs
parent5c9bfde33c9a2afb2f5ab9c7965ce49cea5a997f (diff)
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.
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/wayland/hyprland.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/nixos/modules/programs/wayland/hyprland.nix b/nixos/modules/programs/wayland/hyprland.nix
index 9061ce5da83a8..86f8b570f920b 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; [