about summary refs log tree commit diff
path: root/home/zsh/default.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--home/zsh/default.nix13
1 files changed, 7 insertions, 6 deletions
diff --git a/home/zsh/default.nix b/home/zsh/default.nix
index fad7b2e..086c17e 100644
--- a/home/zsh/default.nix
+++ b/home/zsh/default.nix
@@ -38,13 +38,14 @@ in {
 
       defaultKeymap = "emacs";
 
-      initExtraFirst = ''
-        if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
-          exec sway
-        fi
-      '';
-
+      # the order matters for sway.zsh: I want to load it first
+      # to start the session if I log on a machine where it's
+      # available.
+      # it can't be loaded with `initExtraFirst` because the session
+      # variables from home-manager are not set yet otherwise (and I
+      # need them for things like firefox or emacs).
       initExtra = lib.concatMapStrings builtins.readFile [
+        ./sway.zsh
         ./completion-style.zsh
         ./gerrit.zsh
         ./options.zsh