mzwing

mzwing

Every moment we spent together is well worth recalling.
github
tg_channel
x
email
pixiv
bilibili
gitlab
zhihu
facebook
instagram

NixOS Exploration (Part 1): Prerequisite Knowledge

NixOS, this magical Linux distribution, although I had heard of it before, I only recently managed to successfully complete the stage of "being able to use it normally", and it really tortured me.

Choosing the NixOS Installation Image#

The stable version of NixOS is not a rolling release, but you can quickly update it by modifying the channel, while the unstable version is by default a rolling release.

However, the NixOS download page does not have a download option for the unstable version! Therefore, you can only install the unstable version by replacing the channel with the stable installation image.

NixOS can not only be installed using an installation image. The community provides a program called nix-infect, which can directly replace most cloud server platforms with NixOS. The official Nix program can also install NixOS on another partition (although I haven't tested it). For users who can use network booting, netboot.xyz also provides options for booting from the network.

Note: According to the information provided by sci, nix-infect is not available on the openvz platform, please use nixos-openvz.

If you choose to install using an installation image and install from mainland China, it is strongly recommended to use the desktop image (with the option of Gnome or KDE), so that you can use a graphical interface, Firefox, and pxy (the real purpose (x)), and the subsequent installation will directly retrieve files from the cache of the installation image (of course, if you are a pxy expert, you can ignore this).

Nix Syntax to Master#

Actually, there isn't much, as long as you can read English. The official configuration has a lot of English comments, so don't worry about not understanding them (x).

Let me say in advance, this language is easy to get started with, but it's really difficult to advance.

Nix's assignment is similar to ES6, both are like let xxx = "xxx";.

Objects are a bit strange, not like { xxx: "xxx" }, but like { xxx = "xxx"; }. For example:

let a.b.c = 1;
# output: 
a = { b = { c = 1; }; };
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.