diff --git a/common/home.nix b/common/home.nix index 235c9fb6..dfa3f941 100644 --- a/common/home.nix +++ b/common/home.nix @@ -36,15 +36,14 @@ in { [ inputs.nix-index-database.hmModules.nix-index # ./wezterm.nix + # ./goread.nix + # ./zellij.nix ./kitty.nix ./gui.nix - ./auth.nix ./tmux.nix ./nvim.nix - # ./goread.nix ./ncmpcpp.nix - # ./zellij.nix ../modules ] ++ lib.optionals device.isLinux [../linux] @@ -352,6 +351,24 @@ in { }; home-manager = {enable = true;}; + aichat = { + enable = true; + settings = { + clients = [ + { + type = "openai-compatible"; + name = "llama"; + api_base = "https://llama.darksailor.dev/v1"; + models = [ + { + name = "minstral"; + } + ]; + } + ]; + model = "llama:minstral"; + }; + }; }; fonts.fontconfig.enable = true; diff --git a/modules/aichat.nix b/modules/aichat.nix new file mode 100644 index 00000000..fc8b92d8 --- /dev/null +++ b/modules/aichat.nix @@ -0,0 +1,42 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.programs.aichat; + yamlFormat = pkgs.formats.yaml {}; + # configDir = + # if pkgs.stdenv.isDarwin then + # "${config.home.homeDirectory}Library/Application Support/aichat" + # else + # "${config.xdg.configHome}/aichat"; +in { + options = { + programs.aichat = { + enable = mkEnableOption "aichat"; + package = mkOption { + type = types.package; + default = pkgs.aichat; + defaultText = literalExpression "pkgs.aichat"; + description = "The aichat package to install."; + }; + + settings = lib.mkOption { + type = yamlFormat.type; + description = "Options"; + }; + }; + }; + + config = { + home.packages = mkIf cfg.enable [cfg.package]; + + xdg.configFile."aichat/config.yaml".source = + yamlFormat.generate "config.yaml" cfg.settings; + # xdg.configFile = mkIf cfg.enable { + # # "aichat/config.yaml".text = generators.toYAML {} cfg.settings; + # }; + }; +} diff --git a/modules/default.nix b/modules/default.nix index 24bab0c5..f957feb7 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -6,6 +6,7 @@ imports = [ ./goread.nix ./hyprpaper.nix + ./aichat.nix # ./sketchybar.nix ]; }