about summary refs log tree commit diff
path: root/home/shell/fish
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--home/shell/fish/default.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/home/shell/fish/default.nix b/home/shell/fish/default.nix
new file mode 100644
index 0000000..3a21b24
--- /dev/null
+++ b/home/shell/fish/default.nix
@@ -0,0 +1,29 @@
+{ config, lib, pkgs, ... }:
+let
+  cfg = config.my.home.shell;
+  swayEnabled = config.my.home.wm.windowManager == "sway";
+in
+{
+  config = lib.mkIf (cfg.name == "fish") {
+    programs.fish = {
+      enable = true;
+      interactiveShellInit = ''
+        set fish_greeting
+
+        # Tmux on terminal start, unless we're in a SSH connection
+        if status is-interactive
+          if test -z "$SSH_CONNECTION"
+            if not tmux has-session 2>/dev/null; or test -z "$TMUX"
+              exec tmux new-session -A -s 0
+            end
+          end
+        end
+      '';
+      loginShellInit = lib.mkIf swayEnabled ''
+        if test -z "$DISPLAY"; and test (tty) = "/dev/tty1"
+          exec sway
+        end
+      '';
+    };
+  };
+}