⏩
GuixのSubstituteサーバーを設定する
デフォルトのSubstituteサーバーを使っていたところ、私の環境では通信速度が遅く不便でした。そこで上海交通大学が提供してくれているミラーサーバーを設定してみたら早くなったので、その方法を紹介します。
一時的にSubstituteサーバーを使う
--substitute-urls
オプションを使うことで、設定されているものとは別のSubstituteサーバーを一時的に使うことができます。速度を調べてみたいときなどに便利です。
guix intall パッケージ名 --substitute-urls="https://mirror.sjtu.edu.cn/guix/"
Guix Systemの場合
%desktop-service
を使っていた場合は%base-service
の部分を%desktop-service
に変更してください。
(operating-system
...
(services
(append
(modify-services %base-service
(guix-service-type config =>
(guix-configuration
(inherit config)
(substitute-urls
(append
(list "https://mirror.sjtu.edu.cn/guix")
%default-substitute-urls)))))
(list
(service ...
その他のディストリビューションの場合
試していませんが、guix-daemon.service
を以下のようにするとできるらしいです。
guix-daemon.service
ExecStart=/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild --substitute-urls="https://mirror.sjtu.edu.cn/guix/"
リンク
他にも有志によるミラーサーバーがいくつかあるようです。
参考
Discussion