From d441222559b6d4eed04adf7b6de3460d3ca4ef56 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Thu, 2 Jan 2025 02:28:31 +0900 Subject: [PATCH] Remove Linux only shell completions from darwin rc (#917) --- home-manager/bash.nix | 3 --- home-manager/linux.nix | 12 ++++++++++++ home-manager/zsh.nix | 2 -- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/home-manager/bash.nix b/home-manager/bash.nix index 0f2df93c..737d2f19 100644 --- a/home-manager/bash.nix +++ b/home-manager/bash.nix @@ -4,7 +4,6 @@ pkgs, ... }: - { services.gpg-agent.enableBashIntegration = true; programs.starship.enableBashIntegration = true; @@ -119,8 +118,6 @@ starship_precmd_user_func="set_win_title" source "${pkgs.fzf-git-sh}/share/fzf-git-sh/fzf-git.sh" - source "${pkgs.podman}/share/bash-completion/completions/podman" - source "${pkgs.kubectl}/share/bash-completion/completions/kubectl.bash" source "${pkgs.zellij}/share/bash-completion/completions/zellij.bash" # https://github.com/NixOS/nixpkgs/pull/362139 diff --git a/home-manager/linux.nix b/home-manager/linux.nix index 8450af0b..09c8e8a8 100644 --- a/home-manager/linux.nix +++ b/home-manager/linux.nix @@ -51,6 +51,18 @@ ]); }; + programs = { + bash.initExtra = '' + source "${pkgs.podman}/share/bash-completion/completions/podman" + source "${pkgs.kubectl}/share/bash-completion/completions/kubectl.bash" + ''; + + zsh.initExtra = '' + source "${pkgs.podman}/share/zsh/site-functions/_podman" + source "${pkgs.kubectl}/share/zsh/site-functions/_kubectl" + ''; + }; + # xdg-user-dirs NixOS module does not work or is not enough for me to keep English dirs even in Japanese locale. # Check your `~/.config/user-dirs.dirs` if you faced any trouble # https://github.com/nix-community/home-manager/blob/release-24.11/modules/misc/xdg-user-dirs.nix diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix index 810414d4..4685de27 100644 --- a/home-manager/zsh.nix +++ b/home-manager/zsh.nix @@ -228,8 +228,6 @@ in precmd_functions+=(set_win_title) source "${pkgs.fzf-git-sh}/share/fzf-git-sh/fzf-git.sh" - source "${pkgs.podman}/share/zsh/site-functions/_podman" - source "${pkgs.kubectl}/share/zsh/site-functions/_kubectl" # https://github.com/NixOS/nixpkgs/pull/362139 source "${pkgs.unstable.dprint}/share/zsh/site-functions/_dprint" # cargo-make recommends to use bash completions for zsh