Files
nix-flake/modules/features/shells/zsh.nix
T
greyweather 7f49c289d5 all application options will adapt to environment
when used either with nixos (no home-manager) or home-manager standalone, `features.applications.<name>.enable` options still perform some functionality, rather than assuming a full nixos + home-manager setup like before
2026-08-29 13:48:20 +01:00

48 lines
1.5 KiB
Nix

{ inputs, self, ... }: {
flake.nixosModules.global = { config, pkgs, lib, ... }: {
options.features.shells.zsh = {
enable = lib.mkEnableOption "zsh";
antidote.enable = lib.mkEnableOption "antidote";
};
config = lib.mkIf (config.features.shells.zsh.enable) {
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
users.users."grey".shell = pkgs.zsh;
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
features.shells.zsh.enable = lib.mkDefault true;
features.shells.zsh.antidote.enable = lib.mkDefault config.features.shells.zsh.antidote.enable;
};
};
};
flake.homeModules.global = { pkgs, config, lib, ... }: {
options.features.shells.zsh = {
enable = lib.mkEnableOption "zsh";
antidote.enable = lib.mkEnableOption "antidote";
};
config = lib.mkIf (config.features.shells.zsh.enable) {
home.shell.enableZshIntegration = true;
programs.kitty.shellIntegration.enableZshIntegration = true;
programs.zsh = {
enable = true;
completionInit = "";
antidote = lib.mkIf (config.features.shells.zsh.antidote.enable) {
enable = true;
plugins = [
"getantidote/use-omz"
"ohmyzsh/ohmyzsh path:lib"
"ohmyzsh/ohmyzsh path:plugins/command-not-found"
"ohmyzsh/ohmyzsh path:themes/nanotech.zsh-theme"
"zsh-users/zsh-autosuggestions"
"zdharma-continuum/fast-syntax-highlighting"
];
};
};
};
};
}