diff --git a/deploy-aero-now.sh b/deploy-aero-now.sh new file mode 100755 index 0000000..3056463 --- /dev/null +++ b/deploy-aero-now.sh @@ -0,0 +1 @@ +nixos-rebuild switch --flake .#aero --target-host root@192.168.0.48 diff --git a/hosts/aero/home.nix b/hosts/aero/home.nix index 6d75424..f72391e 100755 --- a/hosts/aero/home.nix +++ b/hosts/aero/home.nix @@ -51,4 +51,7 @@ }; }; }; + + wayland.windowManager.hyprland.settings.input.kb_options = [ "lv3:caps_switch" ]; + services.nextcloud-client.enable = true; } diff --git a/modules/home-manager/modules/nixvim/base/completion.nix b/modules/home-manager/modules/nixvim/base/completion.nix index c8ac599..1dc0778 100644 --- a/modules/home-manager/modules/nixvim/base/completion.nix +++ b/modules/home-manager/modules/nixvim/base/completion.nix @@ -15,38 +15,6 @@ in }; config = lib.mkIf cfg.enable { - extraConfigLua = - lib.mkIf cfg.ollama - #lua - '' - require('minuet').setup({ - provider = 'openai_fim_compatible', - n_completions = 1, - context_window = 1024, - provider_options = { - openai_fim_compatible = { - api_key = 'TERM', - name = 'Ollama', - end_point = 'http://localhost:11434/v1/completions', - model = 'deepseek-coder-v2:16b', - optional = { - max_tokens = 56, - stop = { '\n' }, - top_p = 0.9, - }, - }, - }, - virtualtext = { - show_on_completion_menu = true, - auto_trigger_ft = { "*" }, - keymap = { - accept = '', - }, - }, - throttle = 0, - debounce = 0, - }) - ''; plugins = { luasnip.enable = true; lspkind = { @@ -62,6 +30,50 @@ in enable = true; settings.suggestion.auto_trigger = true; }; + minuet = lib.mkIf cfg.ollama { + enable = true; + settings = { + provider = "openai_fim_compatible"; + n_completions = 1; + context_window = 2048; + throttle = 0; + debounce = 0; + provider_options.openai_fim_compatible = { + api_key = "TERM"; + name = "Llama.cpp"; + end_point = "http://localhost:8012/v1/completions"; + model = "PLACEHOLDER"; + optional = { + max_tokens = 56; + top_p = 0.9; + }; + # Llama.cpp does not support the `suffix` option in FIM completion. + # Therefore, we must disable it and manually populate the special + # tokens required for FIM completion. + template = { + prompt.__raw = '' + function(context_before_cursor, context_after_cursor, _) + return '<|fim_prefix|>' + .. context_before_cursor + .. '<|fim_suffix|>' + .. context_after_cursor + .. '<|fim_middle|>' + end + ''; + suffix = false; + }; + }; + cmp.enable_auto_complete = false; + blink.enable_auto_complete = false; + lsp.completion.enable = false; + virtualtext = { + auto_trigger_ft = [ "*" ]; + keymap = { + # TODO: keymap + }; + }; + }; + }; cmp = { enable = true; settings = { @@ -101,6 +113,5 @@ in }; }; }; - extraPlugins = lib.mkIf cfg.ollama [ pkgs.vimPlugins.minuet-ai-nvim ]; }; } diff --git a/modules/home-manager/programs/nixvim.nix b/modules/home-manager/programs/nixvim.nix index c7d9b4b..e30061d 100644 --- a/modules/home-manager/programs/nixvim.nix +++ b/modules/home-manager/programs/nixvim.nix @@ -45,6 +45,7 @@ completion = { enable = true; copilot = true; + ollama = false; }; diagnostics.enable = true; coverage.enable = false; diff --git a/modules/nixos/usecases/localai.nix b/modules/nixos/usecases/localai.nix index ed139cd..9273428 100644 --- a/modules/nixos/usecases/localai.nix +++ b/modules/nixos/usecases/localai.nix @@ -1,6 +1,7 @@ { config, lib, + pkgs, username, ... }: @@ -16,10 +17,10 @@ in }; config = mkIf cfg.enable { + home-manager.users.${username}.home.packages = [ pkgs.llama-cpp-rocm ]; services = { - ollama.enable = true; open-webui = { - enable = true; + enable = false; port = 57461; environment = { ANONYMIZED_TELEMETRY = "False";