Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
little-bear-x opened this issue Feb 2, 2025 · 0 comments
Open

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

little-bear-x opened this issue Feb 2, 2025 · 0 comments
Labels
question Further information is requested

Comments

@little-bear-x
Copy link

🧐 问题描述

我第一次使用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
  • 是否包含独立运行时:?
@little-bear-x little-bear-x added the question Further information is requested label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant