From 6c016d50a47af4390627579f56b168193d75ba50 Mon Sep 17 00:00:00 2001 From: definfo Date: Fri, 30 Aug 2024 23:26:21 +0800 Subject: [PATCH] doc: add installation guide for NixOS --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index d0123b8..0203067 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,44 @@ https://user-images.githubusercontent.com/14821247/213079440-f0ab2ddd-5e44-4e41- 手动从源码编译与上面类似,其他 linux 发行版也差不多 +### NixOS + +可以参考 NUR 打包 [nur.repos.definfo.rime-ls](https://github.com/nix-community/nur-combined/blob/master/repos/definfo/pkgs/rime-ls/default.nix) + +使用 home-manager 管理配置时,应将 `shared_data_dir` 路径替换为 `${pkgs.nur.repos.definfo.rime-ls}/share/rime-data` + +以 Helix 为例: + +```nix + programs.helix = { + languages = { + language-server.rime-ls = { + command = "${pkgs.nur.repos.definfo.rime-ls}/bin/rime_ls"; + config.shared_data_dir = "${pkgs.nur.repos.definfo.rime-ls}/share/rime-data"; + config.user_data_dir = "${config.home.homeDirectory}/.local/share/rime-ls"; + config.log_dir = "${config.home.homeDirectory}/.local/share/rime-ls"; + config.max_candidates = 9; + config.trigger_characters = [ ]; + config.schema_trigger_character = "&"; + config.max_tokens = 4; + config.always_incomplete = true; + config.long_filter_text = true; + }; + language = [ + { + name = "markdown"; + scope = "source.markdown"; + file-types = [ + "md" + "markdown" + ]; + language-servers = [ "rime-ls" ]; + } + ]; + }; + }; +``` + ### Windows 1. 配置 Rust 环境, 安装额外依赖 `clang` 和 `librime`