mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 15:04:59 +08:00
Make zsh autocompletion work on macOS (#50)
This commit is contained in:
parent
9aca65a017
commit
737dcda77e
2 changed files with 17 additions and 0 deletions
16
nix-darwin/zsh-completion-fix.nix
Normal file
16
nix-darwin/zsh-completion-fix.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Fix broken autocompletion. See https://github.com/nix-community/home-manager/issues/2562.
|
||||
{ flake, ... }:
|
||||
|
||||
{
|
||||
home-manager.users.${flake.config.people.myself}.imports = [
|
||||
({ config, ... }: {
|
||||
programs.zsh.initExtraBeforeCompInit = ''
|
||||
fpath+=("${config.home.profileDirectory}"/share/zsh/site-functions "${config.home.profileDirectory}"/share/zsh/$ZSH_VERSION/functions "${config.home.profileDirectory}"/share/zsh/vendor-completions)
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
# Even though we enable zsh in home-manager, we still need to enable the
|
||||
# nix-darwin module to make completions work.
|
||||
programs.zsh.enable = true;
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
imports = [
|
||||
flake.inputs.self.darwinModules.default
|
||||
../nix-darwin/ci.nix
|
||||
../nix-darwin/zsh-completion-fix.nix
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue