• 0 Posts
  • 5 Comments
Joined 2 年前
cake
Cake day: 2023年6月22日

help-circle
  • This is a good example of what people consistently overlook/misunderstand, when it comes to Nix.

    Obviously you can remount a /home, or just pull the dotfiles from a personal repo, but the strength of Nix is also in that I can re-create my entire config exactly how it is defined. If i were to setup a machine completely from scratch, with a mature enough config, it will get me from 0 to my exact desktop completely unattended.

    But there are also many more advantages to it, at least in my eyes. Let’s take trying/tweaking new packages as an example. Yesterday I pulled an old repo for an Outer Wilds mod. The thing needs a dev environment, and a mod manager for the actual game. A nix shell got me both, I finished my work, and when I exit out of fish, both are gone, just as I wanted them to be.

    Another good example would be partial os updates. I’ve used Arch for almost 9 years before switching to Nix, and pretty much a top3 Arch rule is not doing partial updates, or partial rollbacks. In case of a breakage, I would have to manually redownload an older version of a tarball, pacman -U the package, and then hope i’m not cooked. In the case of gcc incompatibilities, it can quickly become a massive pain in the ass. My nix flake would never experience this problem, because I already have two different scenarios available - either i build based on an older lockfile from my git repo, or I create an overlay for a specific input I need, so that it still pulls what it needs, and doesn’t interfere with the rest of my system


  • Correct. Atomic distros don’t apply the update, unless it is ready to be applied successfully all together, usually with an option to restore the previous state, without the need of something like btrfs snapshots.

    With Nix(-OS) as an example - your bootloader entry is just a reference a giant list of what you need to get out of the Nix store, to achieve the config you want. Many of those can coexist in the same system as a result, including different versions of the same package

    This setup won’t really teach you anything different in relation to containers though.