From 749af042cc9f5c6794c4dda30d38767ee0847e3c Mon Sep 17 00:00:00 2001 From: 514fpv Date: Sun, 7 Jan 2024 16:14:53 +0800 Subject: [PATCH] home(sway): source profile in sway wrapper --- home/sway/nixos.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/home/sway/nixos.nix b/home/sway/nixos.nix index f6900dd3..8c01337b 100644 --- a/home/sway/nixos.nix +++ b/home/sway/nixos.nix @@ -12,7 +12,21 @@ in mkIf gui { [Desktop Entry] Name=Sway Comment=An i3-compatible Wayland compositor - Exec=sway --unsupported-gpu + Exec=${pkgs.writeTextFile { + name = "sway-wrapper"; + executable = true; + text = '' + #!${pkgs.zsh}/bin/zsh + SHLVL=0 + for profile in ''${(z)NIX_PROFILES}; do + fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) + done + exec sway --unsupported-gpu + ''; + checkPhase = '' + ${pkgs.stdenv.shellDryRun} "$target" + ''; + }} Type=Application ''; } // { providedSessions = [ pkgs.sway.meta.mainProgram ]; })