modue stuff

This commit is contained in:
Alexander Khodyrev 2025-08-26 21:44:21 +03:00
parent 1f8cd90ee4
commit 48c4ac4f59

View file

@ -15,6 +15,7 @@
home-manager, home-manager,
... ...
}@inputs: }@inputs:
(
let let
inherit (lib) mkEnableOption mkPackageOption mkIf; inherit (lib) mkEnableOption mkPackageOption mkIf;
lib = nixpkgs.lib; lib = nixpkgs.lib;
@ -45,7 +46,9 @@
gotools gotools
]; ];
}; };
}
)
// {
homeManagerModules.default = homeManagerModules.default =
{ {
config, config,
@ -95,19 +98,25 @@
tomlFormat = pkgs.formats.toml { }; tomlFormat = pkgs.formats.toml { };
configFile = tomlFormat.generate "llm-shell-hint-config" cfg.settings; configFile = tomlFormat.generate "llm-shell-hint-config" cfg.settings;
in in
mkIf cfg.enable { lib.mkIf cfg.enable {
home.packages = [ self.packages."${system}".llm-shell-hint ]; home.packages = [ self.packages."${system}".llm-shell-hint ];
programs.bash.initExtra = mkIf cfg.enableBashIntegration '' programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
${lib.getExe self.packages."${system}".llm-shell-hint} init bash --config-file "${configFile}" | source ${
lib.getExe self.packages."${system}".llm-shell-hint
} init bash --config-file "${configFile}" | source
''; '';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
${lib.getExe self.packages."${system}".llm-shell-hint} init zsh --config-file "${configFile}" | source ${
lib.getExe self.packages."${system}".llm-shell-hint
} init zsh --config-file "${configFile}" | source
''; '';
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
${lib.getExe self.packages."${system}".llm-shell-hint} init fish --config-file "${configFile}" | source ${
lib.getExe self.packages."${system}".llm-shell-hint
} init fish --config-file "${configFile}" | source
''; '';
}; };
}; };