NixOS as a desktop/zh: Difference between revisions
Created page with "=== Wiki(维基百科)上的方法 ===" Tags: Mobile edit Mobile web edit |
Created page with "如果你倾向于阅读, 请从NixOS安装指南开始. 如果你想选择一个精良的视频教程, 请见下一条. 请记住, 为了安装一个桌面, 你需要确定一开始有至少30GiB的可用硬盘空间来容纳桌面环境(比如说, GNOME, KDE, 或者是XFCE), 浏览器(比如Firefox), 以及其他带有图形界面的典型日用软件(如VSCode). 对于相对简陋的配置, 15GiB可能够用." Tags: Mobile edit Mobile web edit |
||
Line 8: | Line 8: | ||
=== Wiki(维基百科)上的方法 === | === Wiki(维基百科)上的方法 === | ||
如果你倾向于阅读, 请从[[NixOS Installation Guide|NixOS安装指南]]开始. 如果你想选择一个精良的视频教程, 请见下一条. 请记住, 为了安装一个桌面, 你需要确定一开始有至少30GiB的可用硬盘空间来容纳桌面环境(比如说, GNOME, KDE, 或者是XFCE), 浏览器(比如Firefox), 以及其他带有图形界面的典型日用软件(如VSCode). 对于相对简陋的配置, 15GiB可能够用. | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> |
Revision as of 08:16, 25 February 2025
NixOS可以用於許多目的. 如果你想把它用作你的日常主要桌面作業系統(在實體機上或者作為副虛擬機), 那麼你應該看看這個頁面. 即使你是想把NixOS用在雲端或者是經過特殊配置的伺服器上, 你也可能會想從這裡概述的課程開始, 以便從整體上對Nix生態有更好的了解.
安裝
Wiki(維基百科)上的方法
如果你傾向於閱讀, 請從NixOS安裝指南開始. 如果你想選擇一個精良的視頻教程, 請見下一條. 請記住, 為了安裝一個桌面, 你需要確定一開始有至少30GiB的可用硬碟空間來容納桌面環境(比如說, GNOME, KDE, 或者是XFCE), 瀏覽器(比如Firefox), 以及其他帶有圖形界面的典型日用軟體(如VSCode). 對於相對簡陋的配置, 15GiB可能夠用.
Video guide
For a visual guide, see Wil T Nix Guides. The second video is a concise installation guide. This 8-part series, produced in early 2021, also covers all the basics of using NixOS as a desktop and configuring it to your liking.
Managing your configuration
It is possible to manage your entire configuration using the methods documented in the NixOS official manual. However, most community members who use NixOS on the desktop prefer to manage their user configurations (e.g. "dotfiles") using Home Manager (citation needed). Home Manager is a user oriented tool for declaring what you want installed and how you want it configured, and thus would be used in lieu of most settings you would otherwise put into a configuration.nix or through nix-env
Video guide
Wil T's guides are about an even mix of:
- Hands-on bootstrapping to get to being able to very capably manage your system using Home Manager, git versioning, and eventually Flakes.
- Conceptual overviews and general exposition of the Nix ecosystem, community, and available resources.
The second video, starting from about 27 minutes in, is also an introduction to and guide to setting up Home Manager.
Modularizing your configuration
With NixOS Modules
configuration.nix is an instance of a NixOS module, which makes it easy to break your configuration into several files. Modules can:
- Import other modules
- Declare new options
- Provide values for options (this is what most of your default configuration.nix does)
- Reference option values from other modules (via the
config
attribute passed to all modules)
As long as you declare options for any values you want to share between modules, you can divide your configuration however you like into files that get imported, directly or transitively, by your root configuration.nix file. You can also import modules from remote sources, using functions like builtins.fetchTarball
. See the wiki page or the NixOS manual for more information.
With Flakes
If you want a more composable[citation needed] NixOS configuration setup, the still-experimental Flakes feature is causing a lot of excitement in the community. Managing flakes requires a good basic understanding and some existing hands on experience with the Nix ecosystem.
Video guide
Videos seven and eight of Wil T's original 8-part series are a good overview of what Flakes enable and how to get started with them.
Beyond initial setup
After you are familiar with the Nix ecosystem and have a functional desktop install of NixOS, you will likely be interested in customizations and more detailed setup.
Learn by example
If you are comfortable managing your system through a git repo using flakes, then there are many repositories you can learn from now!
Check out Comparison of NixOS setups for a table comparing some popular choices.
See Configuration Collection for a long list within the wiki.
Additionally, the following topic searches on Github should uncover many useful examples.