diff --git a/README-CN.md b/README-CN.md index d74968f..5314eea 100644 --- a/README-CN.md +++ b/README-CN.md @@ -62,6 +62,28 @@ Radiance是一个Minecraft Mod,旨在将原版的OpenGL渲染器完全替换 * `libnvidia-ngx-dlss.so.310.5.3` * `libnvidia-ngx-dlssd.so.310.5.3` +##### 针对 NixOS 的额外说明 + +由于 NixOS 的运行机制,**默认情况下本模组无法在 NixOS 上运行**。 +以下说明将指导你如何调整 NixOS,从而向你的启动器(**此处以 PrismLauncher 为例**)暴露 Radiance 运行所需的额外库文件: + +1. 编辑你的 `configuration.nix` 文件或你的 `Nix flake`(取决于你使用哪种方式配置 —— 如果你不知道 `flake` 是什么,那么你应该使用 `configuration.nix`)。 +2. 找到配置中包含已安装软件包的部分(默认为 `environment.systemPackages`,但如果你使用 Home-Manager,则为 `home-manager.users..home.packages`)。 +3. 在该部分中,你应该能看到 `prismlauncher`(或 `pkgs.prismlauncher`)。 +4. 如果名称仅为 `prismlauncher`,请将其替换为以下代码块: +```nix +(prismlauncher.override { + additionalLibs = [ + pkgs.bzip2 + pkgs.xz + pkgs.openssl + ]; +}) +``` +*注意:如果名称为 `pkgs.prismlauncher`,只需在 `prismlauncher.override` 前加上 `pkgs.` 即可(例如:`pkgs.prismlauncher.override { }`)* + +5. 完成后,以 root 身份运行 `nixos-rebuild switch`,关闭并重新打开 PrismLauncher,一切就准备就绪了。 + # 构建 首先,用`gradle`编译Java来生成JNI头文件。 diff --git a/README.md b/README.md index e7df2c7..fc7eccb 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,29 @@ Download the files listed below from [here](https://github.com/NVIDIA/DLSS/tree/ * `libnvidia-ngx-dlss.so.310.5.3` * `libnvidia-ngx-dlssd.so.310.5.3` +##### Additional instructions for NixOS + +Because of how NixOS works, **the mod, won't work by default** on NixOS. +The following instructions will show you how to tweak NixOS to expose the additional libs required by Radiance to your launcher (**PrismLauncher will serve as an example here**): + +1. Edit your `configuration.nix` file or your `Nix flake` (depending on what you use - if you don't know what a `flake` is, then you should be using `configuration.nix`). + +2. Locate the part of your configuration that contains installed packages (by default, it is `environment.systemPackages`, but if you use Home-Manager it is `home-manager.users..home.packages`). +3. In said part, you should see `prismlauncher` (or `pkgs.prismlauncher`) +4. If the name was only `prismlauncher`, replace it with the following code block: +```nix +(prismlauncher.override { + additionalLibs = [ + pkgs.bzip2 + pkgs.xz + pkgs.openssl + ]; +}) +``` +*Note: If the name was `pkgs.prismlauncher`, just append `pkgs.` before `prismlauncher.override` (e.g: `pkgs.prismlauncher.override { }`)* + +5. After this, run `nixos-rebuild switch` as root, close and re-open PrismLauncher, and you should be good to go. + # Build First, compile Java with `gradle` to generate the JNI native headers.