I recently migrated from arch to nixOS and would like to know how you manage your Zsh plugins. I have used ansible to manage my dotfiles in the past, but would like to have more stuff configured declaratevly in my configuration.nix
I’m not using home-manager (yet) and I have seem some plugins (but not all of them) are packaged in nixpkgs. Also in nixpkgs are a few zsh plugin-managers, like zplug e.g. but I’m wondering if the plugin-management could be done with nix itself instead of using a manager.
What would be the best way to have them installed and configured as default for all users? Any hints? Any experienced Zsh + NixOS users that would like to share their setup?
I used to use antibody when I first migrated, but I found NixOS is a pretty good zsh plugin manager all by itself. You can see starting from my interactiveShellInit, that I actually pull plugins directly from nixpkgs and just source them directly into the global rc.
I really don’t use that many plugins, but since I am really concerned with shell load time, this is an ideal solution, as I don’t have to wait on a plugin manager every time my shell starts. You can see I am using some plugins from oh-my-zsh, for example, without having to actually configure or use the entire oh-my-zsh setup (saving significant load time).
If you want to do something similar, but the plugin you use isn’t in nixpkgs, you could simply define an overlay for it and go from there. Good luck.
I manage my machine’s configuration and my home-manager configs with flakes, so I will be replacing that builtins.fetchGit lines with flake and have the management and updates be done via the flake.lock file.