From 24abca0ffe067ed83ba24f46a599f1d986b556a1 Mon Sep 17 00:00:00 2001 From: ooks-io Date: Mon, 22 Apr 2024 19:05:13 +1200 Subject: [PATCH] refactor(fish): move ssh auth sock fish variable to ssh module --- home/modules/console/shell/fish/default.nix | 3 --- home/modules/console/utility/ssh/default.nix | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/home/modules/console/shell/fish/default.nix b/home/modules/console/shell/fish/default.nix index 0ac3802..fe9b79d 100644 --- a/home/modules/console/shell/fish/default.nix +++ b/home/modules/console/shell/fish/default.nix @@ -51,9 +51,6 @@ in source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish" set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d" '' + - '' - set -gx SSH_AUTH_SOCK ~/.1password/agent.sock - '' + # Use vim bindings and cursors '' fish_vi_key_bindings diff --git a/home/modules/console/utility/ssh/default.nix b/home/modules/console/utility/ssh/default.nix index 7dd80d6..e163a5b 100644 --- a/home/modules/console/utility/ssh/default.nix +++ b/home/modules/console/utility/ssh/default.nix @@ -2,11 +2,13 @@ let cfg = config.homeModules.console.utility.ssh; + fish = config.homeModules.console.shell.fish; + inherit (lib) mkIf; in { - config = lib.mkIf cfg.enable { + config = mkIf cfg.enable { programs.ssh = { enable = true; extraConfig = /* config */'' @@ -14,6 +16,9 @@ in IdentityAgent "~/.1password/agent.sock" ''; }; + fish.interactiveShellInit = mkIf fish.enable '' + set -gx SSH_AUTH_SOCK ~/.1password/agent.sock + ''; }; }