From 3ad1cf542f4d5ed1d5d0d407f01de18b6c5f227b Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 15 Sep 2024 10:54:10 -0400 Subject: [PATCH 1/2] hyprland,sway: import PATH to systemd --- homeManagerModules/desktop/hyprland/default.nix | 6 +++++- homeManagerModules/desktop/sway/settings.nix | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/homeManagerModules/desktop/hyprland/default.nix b/homeManagerModules/desktop/hyprland/default.nix index e42d1e9b..e317adbb 100644 --- a/homeManagerModules/desktop/hyprland/default.nix +++ b/homeManagerModules/desktop/hyprland/default.nix @@ -10,7 +10,11 @@ in { wayland.windowManager.hyprland = { enable = true; settings = import ./settings.nix {inherit config lib pkgs;}; - systemd.enable = true; + + systemd = { + enable = true; + variables = ["PATH"]; + }; extraConfig = let moveMonitorBinds = diff --git a/homeManagerModules/desktop/sway/settings.nix b/homeManagerModules/desktop/sway/settings.nix index fe7509c4..7f1b13cd 100644 --- a/homeManagerModules/desktop/sway/settings.nix +++ b/homeManagerModules/desktop/sway/settings.nix @@ -23,6 +23,8 @@ in { "systemctl --user stop sway-session.target" "systemctl --user start sway-session.target" ]; + + variables = ["PATH"]; }; config = { From 1a173bb10dd5ac3e7eb97450491f30a721d92df3 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 15 Sep 2024 10:54:32 -0400 Subject: [PATCH 2/2] waybar: use existing PATH otherwise nwg-drawer can't launch applications --- .../services/waybar/default.nix | 50 ++++++++----------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/homeManagerModules/services/waybar/default.nix b/homeManagerModules/services/waybar/default.nix index 6a421e5d..bffa94cd 100644 --- a/homeManagerModules/services/waybar/default.nix +++ b/homeManagerModules/services/waybar/default.nix @@ -7,6 +7,26 @@ cfg = config.ar.home; in { config = lib.mkIf cfg.services.waybar.enable { + home.packages = + (with pkgs; [ + blueberry + bluez + coreutils + getopt + gnugrep + libnotify + mako + networkmanager + networkmanager_dmenu + nwg-drawer + pavucontrol + procps + rofi-power-menu + systemd + ]) + ++ lib.optional (cfg.desktop.hyprland.enable) config.wayland.windowManager.hyprland.package + ++ lib.optional (cfg.desktop.sway.enable) config.wayland.windowManager.sway.package; + programs.waybar = { enable = true; @@ -320,35 +340,7 @@ in { systemd.user.services.waybar = { Install.WantedBy = lib.mkForce (lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"); - Service = { - Environment = lib.mkForce [ - "PATH=${ - lib.makeBinPath ([ - config.programs.rofi.package - config.wayland.windowManager.hyprland.package - config.wayland.windowManager.sway.package - ] - ++ (with pkgs; [ - blueberry - bluez - coreutils - getopt - gnugrep - libnotify - mako - networkmanager - networkmanager_dmenu - nwg-drawer - pavucontrol - procps - rofi-power-menu - systemd - ])) - }" - ]; - - Restart = lib.mkForce "no"; - }; + Service.Restart = lib.mkForce "no"; Unit.BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target"; };