aboutsummaryrefslogtreecommitdiff
path: root/home/shell/fish/default.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-02-20 19:08:57 -0800
committerFranck Cuny <franck@fcuny.net>2023-02-21 12:59:08 -0800
commit1fe21928c76b04775f40b49b74ba91ebec1be40e (patch)
tree063e1ede6fa4c7ed84e51b20164aae13b2e38da0 /home/shell/fish/default.nix
parentfeat(home/pass): add passage (diff)
downloadinfra-1fe21928c76b04775f40b49b74ba91ebec1be40e.tar.gz
feat(home/fish): move fish's code to external files
It's easier to edit / debug / test the code that way. This also add a new function (`find-ssh-agent') to find or start a new ssh agent when a shell is started.
Diffstat (limited to 'home/shell/fish/default.nix')
-rw-r--r--home/shell/fish/default.nix21
1 files changed, 3 insertions, 18 deletions
diff --git a/home/shell/fish/default.nix b/home/shell/fish/default.nix
index d000cd9..f3e41d9 100644
--- a/home/shell/fish/default.nix
+++ b/home/shell/fish/default.nix
@@ -1,7 +1,6 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.shell;
- swayEnabled = config.my.home.wm.windowManager == "sway";
aliases = config.my.home.shell.aliases;
in
{
@@ -9,24 +8,10 @@ in
programs.fish = {
enable = true;
shellAliases = aliases;
- 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
- '';
+ interactiveShellInit = builtins.readFile ./interactive.fish;
+ loginShellInit = builtins.readFile ./login.fish;
};
+
xdg.configFile."fish/functions" = {
source = ./functions;
recursive = true;