refactor(nixos:zsh): move options to hm module

This commit is contained in:
ooks-io 2024-07-12 19:39:29 +12:00
parent 9b2edd3782
commit f9b620c54c

View file

@ -1,24 +1,19 @@
{ lib, config, ... }: { lib, config, ... }:
let let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf;
adminShell = config.ooknet.host.admin.shell; adminShell = config.ooknet.host.admin.shell;
cfg = config.ooknet.shell.zsh;
in in
{ {
config = mkIf (adminShell == "zsh") {
options.ooknet.shell.zsh.enable = mkEnableOption "Enable zsh module"; # enable nixpkgs module if zsh is the main users login shell
# configure with home-manager module
config = mkIf (adminShell == "zsh" || cfg.enable) {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true; # disable completion option as we configure with home-manager module
autosuggestions = { enableCompletion = false;
enable = true;
async = true;
};
}; };
environment.pathsToLink = ["/share/zsh"]; environment.pathsToLink = ["/share/zsh"];
}; };