(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=40786644

Fedora Atomic 是一个稳定可靠的基础操作系统,与 Distrobox 有效结合,提供了先进的开发环境和易用性。 这是一个快速概述: 借助 Fedora Atomic,您可以获得一个具有 Chrome 操作系统稳定性和反熵特性的操作系统,同时还能够通过创建自定义图像或采用可逆覆盖来实现个性化。 其均衡的更新计划提供及时的软件升级(不包括主要版本),确保兼容性和测试。 Distrobox 通过支持创建容纳不同 Linux 发行版的容器化环境来补充此设置。 这些容器与主机系统顺利合并,授予对硬件设备、主目录等共享资源的访问权限,并能够轻松导出应用程序。 通过使用 Distrobox 以及 PyTaxis 和 BoxBuddy-rs 等相关管理工具,开发人员可以在稳定的基础系统旁边维护灵活的容器化环境。 实现此方法的关键点包括利用预配置的映像,例如 Universal Blue,而不是普通的 Fedora Atomic,因为它的配置过程无忧无虑。 此外,在通过 rpm-ostree 层添加系统组件时要小心,将基本应用程序保留在这些容器中,而不是将它们与核心系统交织在一起以获得最佳效率。

相关文章

原文






























































































































































































If you want a combination of a base operating system that is rock solid stable and reliable, and a development environment that is bleeding edge, I really highly recommend checking out Fedora Atomic combined with Distrobox[2]. I think it's honestly basically the ideal setup:

1. with Fedora Atomic you get an operating system with the reliability and resistance to entropy and ability to power wash of Chrome OS, but also the ability to be changed via building your own custom image (its easy, check out BlueBuild) or with easily reversable overlays, plus an update cadence that offers an excellent middle ground between rolling release and point release — you get all non major version updates to your image's software basically immediately, but major versions wait for every 6 months so they can be integration tested and stuff.

2. And then with Distrobox you get the ability to trivially create a containerized environment with your Linux distribution of choice inside (can be different from the host), that nevertheless integrates almost seamlessly with the host (including having access to all of your hardware devices and your home directory and being able to trivially export applications, as well as easily open a shell inside the container with a simple terminal command), so you can have your cake and eat it too: a fully bleeding edge rolling release distro like Fedora Rawhide or Arch Linux inside your distro box to get the most up to date developer tools, but a more stable system as your host. And if something goes wrong in the container you can easily just blow it away and regenerate it since Distrobox has a declarative container spec (distrobox assemble). For GUI management of Distroboxes check out Pytaxis and BoxBuddy-rs.

There are some things you should know if you go this route though that will save you a lot of pain and frustration:

1. Fedora Atomic is really barebones by default, and since layering is kind of painful it can be really annoying to do the system administration necessary to get it set up; especially if you have an Nvidia card and you have to do all the typical annoying shit you have to do on Linux to set that up. So instead of using vanilla Fedora Atomic, I highly recommend checking out Universal Blue[0], which offers pre-built Fedora Atomic images with all of that annoying setup and system administration done for you already. Their headline images (Bazzite and Bluefin) are really opinionated, but don't worry about that, their base images[1] are perfectly usable too! That's what I use :)

2. Layering packages via rpm-ostree should not be used for just random system utilities or applications. That's not how it is intended to be used, and that way lies only pain. The whole point is that the applications you use as a user, including terminal ones, should be separate from the core system, and not dependent on it, so they can be updated separately and not break each other. Layers, since they are updated by the system package manager, must be versioned in lockstep with the rest of the system, and the system image will fail to build if it can't update the layers you have, so really only use it for things you consider part of your essential OS. People who forget this tend to come away really hating Atomic distros. For your development environment or any build environments you need, create distroboxes and install applications inside them; for GUI applications, just use Flatpak, or install the application inside a distrobox and use distrobox-export to integrate the app into the host. If distrobox feels too heavyweight, or you just want various sundry utilities installed on your host system, then I recommend using something like Homebrew or Nix or Guix or Pkgsrc, that is, any package manager that installs things to your home directory in a way that is cleanly separated from your host system and independently updated. Universal Blue images come with a script to get Homebrew all set up for you. Wouldn't have been my first choice, but its very convenient.

For more on the benefits of this, see this pastebin article I made: https://rentry.co/mm2qcwzh

If you're wondering what the advantage of this is over Nix, the most important to advantages for me are that:

1. Nix's directory structure is basically completely unreadable and unusable for human beings in a way that is far worse than the default posix directory structure

2. Nix requires absolutely every program and package that runs on it to be custom patched to deal with its alternate directory structure, and while sure yes it's package repository is gigantic so a lot of that work is done for you, it can still cause weird problems and make things much more unreliable and good luck if there's a package that isn't there or hasn't been updated for a while. I'm on an emacs Discord and apparently installing it on Nix is very difficult. It's just another layer of possible incompatibility and failure and annoyance on top of the stack of those layers that compose linux.

Meanwhile, you got most of the same benefits on an atomic distro, except:

1. it's all completely human readable

2. uses standardized technology so it's already compatible with everything without having to do any work

3. you can get fully different distros inside distro boxes, unlike with and Nix's equivalent.

The other thing is that with nix, you configure your entire system at a layer of abstraction above what's actually happening on the system — it's not like that declarative config is actually directly deciding how the system operates, no, it's just layered on top of all of the existing crap Linux has going on, and you're just hoping that it can automatically, imperatively perform the actions necessary to keep your system in line with the config.

That, and to get the same level of resistance to entropy and reversibility and ability to power wash and rebase and cherry-pick changes and stuff that you get with an atomic distro on nix, you would have to Version Control your Nix config and then also be very very careful with manually committing with informative commit names at regular intervals every time you make a change and stuff, instead of it being handled automatically for you and not requiring an extra version control tool slapped on top.

Plus, Nix doesn't benefit from the minor, but still meaningful in my opinion, security benefits of an immutable image-based distro.

[0]: https://universal-blue.org/ [1]: https://github.com/orgs/ublue-os/packages [2]: https://distrobox.it/

































































































































联系我们 contact @ memedata.com