From 1af5bdd715876a5a01fb9925f6ba084eeb551845 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sun, 4 Feb 2024 17:24:19 +0800 Subject: [PATCH] feat: polish - run fhs binaries --- docs/best-practices/run-downloaded-binaries-on-nixos.md | 1 + docs/zh/best-practices/run-downloaded-binaries-on-nixos.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/best-practices/run-downloaded-binaries-on-nixos.md b/docs/best-practices/run-downloaded-binaries-on-nixos.md index 6924718..f27fcd7 100644 --- a/docs/best-practices/run-downloaded-binaries-on-nixos.md +++ b/docs/best-practices/run-downloaded-binaries-on-nixos.md @@ -3,6 +3,7 @@ Since NixOS does not strictly adhere to the Filesystem Hierarchy Standard (FHS), binaries downloaded from the internet may not work directly on NixOS. However, there are various methods available to make them function properly. For a comprehensive guide that presents ten different approaches to run downloaded binaries on NixOS, I recommend reading the article [Different methods to run a non-nixos executable on Nixos](https://unix.stackexchange.com/questions/522822/different-methods-to-run-a-non-nixos-executable-on-nixos) and take a look at [nix-alien](https://github.com/thiagokokada/nix-alien). +Or if you are familiar with Docker, running the binary in a Docker container is also a good choice. Among these methods, I personally prefer creating an FHS environment to run the binary, as it proves to be both convenient and easy to use. To set up such an environment, you can add the following code to one of your Nix modules: diff --git a/docs/zh/best-practices/run-downloaded-binaries-on-nixos.md b/docs/zh/best-practices/run-downloaded-binaries-on-nixos.md index ff037c0..2a7e3ff 100644 --- a/docs/zh/best-practices/run-downloaded-binaries-on-nixos.md +++ b/docs/zh/best-practices/run-downloaded-binaries-on-nixos.md @@ -3,6 +3,7 @@ NixOS 不遵循 FHS 标准,因此你从网上下载的二进制程序在 NixOS 上大概率是跑不了的。 为了在 NixOS 上跑这些非 NixOS 的二进制程序,需要做一些骚操作。有位老兄在这里总结了 10 种实现此目的的方法:[Different methods to run a non-nixos executable on Nixos](https://unix.stackexchange.com/questions/522822/different-methods-to-run-a-non-nixos-executable-on-nixos),推荐一读。 此外如果你懒得自己折腾,只想实现需求,也可以直接看看这个傻瓜式工具 [nix-alien](https://github.com/thiagokokada/nix-alien). +或者如果你熟悉 Docker,直接用 Docker 跑也是个不错的选择。 我个人用的比较多的方法是,直接创建一个 FHS 环境来运行二进制程序,这种方法非常方便易用。