From 3d084c1d6999576db4139c087a31e32025068737 Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Wed, 18 Sep 2024 11:23:24 +0100 Subject: [PATCH] fish: add manual awscli shell completion --- home/aws.nix | 10 ++++++++++ home/home.nix | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/home/aws.nix b/home/aws.nix index f2987561..6b86d96b 100644 --- a/home/aws.nix +++ b/home/aws.nix @@ -14,11 +14,21 @@ in { type = types.package; default = pkgs.awscli2; }; + + enableFishIntegration = mkEnableOption "fish completion"; }; config = mkIf cfg.enable { home.packages = [ cfg.package ]; + + xdg.configFile."fish/completions/aws.fish".text = '' + function __fish_complete_aws + env COMP_LINE=(commandline -pc) aws_completer | tr -d ' ' + end + + complete -c aws -a "(__fish_complete_aws)" + ''; }; } diff --git a/home/home.nix b/home/home.nix index d60de37d..9acf7159 100644 --- a/home/home.nix +++ b/home/home.nix @@ -96,7 +96,10 @@ in { ]; delta.diff-so-fancy = true; viddy.enable = true; - aws.enable = true; + aws = { + enable = true; + enableFishIntegration = true; + }; theme = "catppuccin-macchiato"; vscode-theme = "Dracula"; defaults = {