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,
...
}@inputs:
(
let
inherit (lib) mkEnableOption mkPackageOption mkIf;
lib = nixpkgs.lib;
@ -45,7 +46,9 @@
gotools
];
};
}
)
// {
homeManagerModules.default =
{
config,
@ -95,19 +98,25 @@
tomlFormat = pkgs.formats.toml { };
configFile = tomlFormat.generate "llm-shell-hint-config" cfg.settings;
in
mkIf cfg.enable {
lib.mkIf cfg.enable {
home.packages = [ self.packages."${system}".llm-shell-hint ];
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 ''
${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 ''
${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
'';
};
};