Jump to content

NixOS на ПК

From NixOS Wiki
This page is a translated version of the page NixOS as a desktop and the translation is 9% complete.
Outdated translations are marked like this.

NixOS может быть использована для разных целей. Если вы желаете использовать её как основную десктопную ОС для повседневного использования (на реальном железе или виртуальной машине(англ.)), то эта страница для вас. Даже если вы планируете использовать NixOS в облаке или на специально настроенных серверах, вы, возможно, хотите начать с уроков, изложенных здесь, чтобы ближе познакомиться с экосистемой Nix.

Установка

Если вы предпочитаете чтение, для начала посмотрите инструкцию по установке. Если же видео, пролистайте ниже до секции "Видео инструкции". Учитывайте, что для десктопной установки, вам потребуется как минимум 30 GiB места на диске, чтобы вместить рабочее окружение (например GNOME, KDE, или XFCE), браузеры (например Firefox), и другие графические утилиты (такие как VSCode), что вполне разумно для повседневного использования. Для минимальной установки, вероятно, хватит и 15 Gib.

Управление своей конфигурацией

Вы можете управлять всей конфигурацией, используя методы, описанные в оффициальном мануале NixOS(англ). Однако, большинство членов сообщества, использующих NixOS на ПК, предпочитают управлять пользовательской конфигурацией ("dotfiles") с помощью Home Manager. Home Manager - утилита, направленная на пользователей, для описания, что вы хотите установить и как оно должно быть настроено, поэтому может быть использовано вместо большинства настроек, которые вы бы добавили в configuration.nix или через nix-env

The process for managing your configuration is documented in the NixOS official manual.

System Configuration

The primary configuration file, /etc/nixos/configuration.nix, defines system-wide settings. This includes options like enabling services, managing system users, setting hardware options, and specifying installed packages. Changes are applied with:

# nixos-rebuild switch

User configuration with Home Manager

For managing per-user configurations such as application preferences, command-line tools, and dotfiles, Home Manager provides a convenient, declarative approach. It allows users to define which programs should be installed and how they should be configured, without needing to include those settings in the system-wide configuration.nix.

Home Manager can be used independently of the system configuration and works with both traditional setups and newer Flakes-based configurations.

С помощью Flakes

For users looking for a more streamlined and reproducible way to manage NixOS configurations, the Flakes feature has been gaining popularity within the community. While Flakes introduce some new concepts compared to traditional workflows, many users find them a convenient and organized approach to managing system and development configurations.

Refer to NixOS system configuration#Defining NixOS as a flake for details on getting started.

Beyond initial setup

Once your basic NixOS installation is complete and functional, you can further customize your system with a variety of optional configurations tailored for desktop use. For a list of recommended initial system configurations, see NixOS Installation Guide#NixOS configuration.

Common configuration areas include:

Desktop Environments

Install and configure full-featured environments such as GNOME, KDE Plasma, or Xfce.

See Category:Desktop environment for a full list.

Window Managers

Set up lightweight or tiling window managers like i3, Sway, Hyprland, or xmonad.

See Category:Window managers for a full list.

Display Managers (Login Managers)

Configure graphical session managers such as GDM, SDDM, or LightDM.

Audio Setup

Enable and configure audio systems like PipeWire, PulseAudio, or ALSA.

Network Management

Use tools such as NetworkManager or systemd-networkd for managing network connections.

Bluetooth Support

Set up Bluetooth with blueman or other management tools.

Power Management

Configure laptop battery management, suspend, and hibernation with tools like tlp or systemd services.

Printing and Scanning

Enable Cups for printer support and tools like Sane for scanning devices.

Модульная конфигурация

С помощью модулей NixOS

See also