BeyondDimension / BeyondDimension/SteamTools

🧐[Question] nixos hosts网络加速问题

Open
#3,609 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C#
Stars
26.8k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### 🧐 问题描述
我第一次使用nixos,我尝试在nixos下使用Steam++加速github和google翻译,由于没有提供nix packages,我尝试通过fhs环境运行Steam++, fhs配置如下:
```
(let base = pkgs.appimageTools.defaultFhsEnvArgs; in
pkgs.buildFHSUserEnv (base // {
name = "fhs";
targetPkgs = pkgs:
(base.targetPkgs pkgs) ++ (with pkgs; [
pkg-config
ncurses
icu
fakeroot
]
);
profile = "export FHS=1";
runScript = "bash";
extraOutputsToInstall = ["dev"];
}))

```
程序能够正常启动,但由于在nixos中hosts文件由系统生成,hosts使用了只读文件系统,即使使用root权限也无法修改。我尝试修改我的configuration.nix,添加了以下内容:
```
environment.etc."hosts" = {
enable = true;
source = lib.mkForce "/var/custom/hosts/custom-hosts";
mode = "0666";
};
```
通过这个方法,我可以在普通模式下修改hosts文件,但在fhs环境下hosts文件仍然是只读的。
请问我应该通过什么方法才能在nixos下使用hosts加速?

- 处理器体系结构:x64
- 系统版本号:nix os
- 下载渠道:Github
- 程序版本:3.0.0 rc.14
- 是否包含独立运行时:?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the reported FHS configuration and the configuration.nix environment.etc."hosts" override, then investigate how NixOS exposes /etc/hosts inside the FHS environment. Done would require a documented, reproducible way to use hosts-based acceleration in this setup, with the read-only behavior resolved or clearly explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, nixos
Domain
networking, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.