Jump to content

NixOS as a desktop/ru: Difference between revisions

From Official NixOS Wiki
Sk7Str1p3 (talk | contribs)
Created page with "== Модульная конфигурация =="
Rose20 (talk | contribs)
No edit summary
 
(43 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<div lang="en" dir="ltr" class="mw-content-ltr">
<div class="mw-translate-fuzzy">
NixOS can be used for many purposes. If you want to use it as a primary desktop operating system for your daily use (either on bare metal or as a [https://twitter.com/mitchellh/status/1346136404682625024 secondary VM]), this page is for you. Even if your ambitions are to use NixOS in the cloud or on specially configured servers, you may want to start with the lessons outlined here in order to get more generally familiar with the Nix ecosystem.
NixOS может быть использована для разных целей. Если вы желаете использовать её как основную десктопную ОС для повседневного использования (на реальном железе или [https://twitter.com/mitchellh/status/1346136404682625024 виртуальной машине](англ.)), то эта страница для вас. Даже если вы планируете использовать NixOS в облаке или на специально настроенных серверах, вы, возможно, хотите начать с уроков, изложенных здесь, чтобы ближе познакомиться с экосистемой Nix.
</div>
</div>


Line 7: Line 7:
== Установка ==
== Установка ==


<span id="Wiki_method"></span>
Если вы предпочитаете чтение, для начала посмотрите [[NixOS_Installation_Guide/ru|инструкцию по установке]]. Учитывайте, что для десктопной установки, вам потребуется как минимум 30 Гб места на диске, чтобы вместить [[:Category:Desktop environment|рабочее окружение]], [[:Category:Web Browser|браузеры]], и другие [[:Category:Applications|графические утилиты]], что вполне разумно для повседневного использования. Для минимальной установки, вероятно, хватит и 15 Гб.
=== Метод Wiki ===
 
<span id="Managing_your_configuration"></span>
== Управление своей конфигурацией ==
 
Как описанно в [[Overview of the NixOS Linux distribution#Declarative Configuration|Обзор NixOS Linux дистрибутива (англ.)]], NixOS декларативный. Это значит, что, полную конфигурацию системы, включая установленные пакеты, сервисы, параметры ядра, и пользовательские аккаунты обьявлены в конфигурационном файле, обычно в <code>/etc/nixos/configuration.nix</code>. Затем эти настройки могут быть применены последовательно и воспроизводимо ко всем компьютерам.
 
Процесс в настройке вашей конфигурации описан в документе {{NixOS Manual|name=NixOS official manual|anchor=#ch-configuration}}.
 
<span id="System_Configuration"></span>
=== Систеиная конфигурация ===


<div lang="en" dir="ltr" class="mw-content-ltr">
{{main|NixOS system configuration}}
If you prefer reading, see [[NixOS Installation Guide]] to get started. For a well presented video option, see video guide section immediately below. Keep in mind that, for a desktop installation, you will probably want to make sure you start with at least 30 GiB of available disk space to allow for the desktop environments (e.g. GNOME, KDE, or XFCE), browsers (e.g. Firefox), and other graphical applications (e.g. VSCode) that would be typical of daily use. 15 GiB might be enough in a pinch for a fairly bare-bones setup.
</div>


<span id="Video_guide"></span>
Онсновным конфигурационным файлом яляется <code>/etc/nixos/configuration.nix</code>, который определяет общие и основные системные настройки. Такие как: активация сервисов, управлением системы пользователей, установки системных настроек, и установки указанных пакетов. Изменения можно увидеть с помощью комманды:
=== Видео инструкции ===


<div lang="en" dir="ltr" class="mw-content-ltr">
<syntaxhighlight lang="console">
For a visual guide, see [[Wil T Nix Guides]]. The [[Wil_T_Nix_Guides#NixOS_Installation_Guide|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.
# nixos-rebuild switch
</div>
</syntaxhighlight>


<span id="Managing_your_configuration"></span>
<span id="User_configuration_with_Home_Manager"></span>
== Обслуживание своей конфигурации ==
=== Пользовательская конфигурация с Home Manager ===


<div lang="en" dir="ltr" class="mw-content-ltr">
Для настройки пользовательских конфигураций, таких как, настройка приложений, коммандных утилит, и dot-файлов, [[Home Manager]] обеспечивает удобный и декларотивный подход. Он позволяет пользователям вписывать какие программы будут устновленны и как настроены, без нужды включать их в общую систему [https://nixos.org/manual/nixos/stable/#sec-changing-config configuration.nix].
It is possible to manage your entire configuration using the methods documented in the [https://nixos.org/manual/nixos/stable/index.html 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 [https://nixos.org/manual/nixos/stable/#sec-changing-config configuration.nix] or through [[FAQ#How_can_I_manage_software_with_nix-env_like_with_configuration.nix.3F|nix-env]]
</div>


<span id="Video_guide"></span>
Home Manager работает независимо от системной концигурации (configuration.nix). Помимо традиционных настроек Home Manager поддерживает новый способ конфигурации, с помощью [[Flakes]].
=== Видео инструкции ===


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="With_Flakes"></span>
Wil T's guides are about an even mix of:
=== С помощью Flakes ===
# 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.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Для пользователей, которые ищут более простой и воспроизводимый способ управления конфигурациями NixOS, в сообществе набирает популярность функция [[Flakes]]. Хотя Flakes предлагает несколько новых концепций по сравнению с традиционными рабочими процессами, многие пользователи находят их удобным и организованным подходом к управлению конфигурациями системы и разработки.
The [[Wil_T_Nix_Guides#NixOS_Installation_Guide|second video]], starting from about 27 minutes in, is also an introduction to and guide to setting up Home Manager.
</div>


<span id="Modularizing_your_configuration"></span>
Смотрите [[NixOS system configuration#Defining NixOS as a flake]] для подробного понимания в начале.
== Модульная конфигурация ==


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
=== With NixOS Modules ===
== Beyond initial setup ==
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
configuration.nix is an instance of a [[NixOS modules|NixOS module]], which makes it easy to break your configuration into several files. Modules can:
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]].
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
* Import other modules
Common configuration areas include:
* 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 <code>config</code> attribute passed to all modules)
</div>
</div>
<span id="Desktop_Environments"></span>
==== Рабочие Окружения ====
Установка и настройка полнофункциональных рабочих окружений таких как [[GNOME]], [[KDE Plasma]], или [[Xfce]].
Смотрите полный список [[:Category:Desktop environment]].
<span id="Window_Managers"></span>
==== Оконные Менеджеры ====
Устновка легковесных или тайловых оконных менеджеров по типу [[i3]], [[Sway]], [[Hyprland]] или [[xmonad]].
Полный список [[:Category:Window managers]]


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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 <code>builtins.fetchTarball</code>. See the [[NixOS modules|wiki page]] or the [https://nixos.org/manual/nixos/stable/#sec-writing-modules NixOS manual] for more information.
==== Display Managers (Login Managers) ====
</div>
</div>  


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
=== With Flakes ===
Configure graphical session managers such as [[Gnome|GDM]], [[KDE|SDDM]], or [[LightDM]].
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Audio_Setup"></span>
If you want a more composable<sup>[citation needed]</sup> 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.
==== Настройка звука ====
</div>
 
Активация и настройка звка [[:Category:Audio|audio]] таких как [[PipeWire]], [[PulseAudio]] или [[ALSA]].
 
<span id="Network_Management"></span>
==== Настройка Сети ====
 
Используйте истумены такие как [[NetworkManager]] или [[systemd-networkd]] для настройки сети [[Networking|network]]
 
<span id="Bluetooth_Support"></span>
==== Поддержка Bluetooth ====
 
Настройте [[Bluetooth]] с помощью blueman или других похожих утилит.


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
==== Video guide ====
==== Power Management ====
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Настройте [[laptop]] [[Power Management|battery management]], сон, и гибернацию с такими инструментами как [[Laptop#tlp|tlp]] или [[systemd]] сервисом.
Videos [[Wil_T_Nix_Guides#Intro_to_Flakes|seven]] and [[Wil_T_Nix_Guides#Moving_NixOS_System_Configuration_into_a_Flake|eight]] of Wil T's original 8-part series are a good overview of what Flakes enable and how to get started with them.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Printing_and_Scanning"></span>
== Beyond initial setup ==
==== Печать и скан ====  
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Включите [[Cups]] для поддержки принтера и инструментов типа Sane для [[Scanners|сканеров]].
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.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Tips_and_tricks"></span>
=== Learn by example ===
== Советы и рекомендации ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Modularizing_your_configuration_with_modules"></span>
If you are comfortable managing your system through a git repo using flakes, then there are many repositories you can learn from now!
=== Модулизация вашей конфигурации с помощью модулей ===
</div>  


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Check out [[Comparison of NixOS setups]] for a table comparing some popular choices.
{{main|NixOS system configuration#Modularizing your configuration with modules}}
</div>
</div>
<span id="See_also"></span>
== См. Также ==


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
See [[Configuration Collection]] for a long list within the wiki.
* [[Overview of the NixOS Linux distribution]]
* [[Comparison of NixOS setups]] for a table comparing some popular choices.
* [[Configuration Collection]] for a long list within the wiki.
* [https://github.com/topics/nix-flake nix-flake], [https://github.com/topics/nixos-configuration nixos-configuration], [https://github.com/topics/nixos-dotfiles nixos-dotfiles] Github topics
* [[Wil T Nix Guides]] Youtube video format guide
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Additionally, the following topic searches on Github should uncover many useful examples.
* [https://github.com/topics/nix-flake nix-flake]
* [https://github.com/topics/nixos-configuration nixos-configuration]
* [https://github.com/topics/nixos-dotfiles nixos-dotfiles]
</div>
[[Category:Desktop]]
[[Category:Desktop]]
[[Category:Guide]]
[[Category:Guide]]
[[Category:NixOS]]
</div>

Latest revision as of 17:06, 24 February 2026

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

Установка

Если вы предпочитаете чтение, для начала посмотрите инструкцию по установке. Учитывайте, что для десктопной установки, вам потребуется как минимум 30 Гб места на диске, чтобы вместить рабочее окружение, браузеры, и другие графические утилиты, что вполне разумно для повседневного использования. Для минимальной установки, вероятно, хватит и 15 Гб.

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

Как описанно в Обзор NixOS Linux дистрибутива (англ.), NixOS декларативный. Это значит, что, полную конфигурацию системы, включая установленные пакеты, сервисы, параметры ядра, и пользовательские аккаунты обьявлены в конфигурационном файле, обычно в /etc/nixos/configuration.nix. Затем эти настройки могут быть применены последовательно и воспроизводимо ко всем компьютерам.

Процесс в настройке вашей конфигурации описан в документе NixOS official manual.

Систеиная конфигурация

Main article: NixOS system configuration

Онсновным конфигурационным файлом яляется /etc/nixos/configuration.nix, который определяет общие и основные системные настройки. Такие как: активация сервисов, управлением системы пользователей, установки системных настроек, и установки указанных пакетов. Изменения можно увидеть с помощью комманды:

# nixos-rebuild switch

Пользовательская конфигурация с Home Manager

Для настройки пользовательских конфигураций, таких как, настройка приложений, коммандных утилит, и dot-файлов, Home Manager обеспечивает удобный и декларотивный подход. Он позволяет пользователям вписывать какие программы будут устновленны и как настроены, без нужды включать их в общую систему configuration.nix.

Home Manager работает независимо от системной концигурации (configuration.nix). Помимо традиционных настроек Home Manager поддерживает новый способ конфигурации, с помощью Flakes.

С помощью Flakes

Для пользователей, которые ищут более простой и воспроизводимый способ управления конфигурациями NixOS, в сообществе набирает популярность функция Flakes. Хотя Flakes предлагает несколько новых концепций по сравнению с традиционными рабочими процессами, многие пользователи находят их удобным и организованным подходом к управлению конфигурациями системы и разработки.

Смотрите NixOS system configuration#Defining NixOS as a flake для подробного понимания в начале.

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:

Рабочие Окружения

Установка и настройка полнофункциональных рабочих окружений таких как GNOME, KDE Plasma, или Xfce.

Смотрите полный список Category:Desktop environment.

Оконные Менеджеры

Устновка легковесных или тайловых оконных менеджеров по типу i3, Sway, Hyprland или xmonad.

Полный список Category:Window managers

Display Managers (Login Managers)

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

Настройка звука

Активация и настройка звка audio таких как PipeWire, PulseAudio или ALSA.

Настройка Сети

Используйте истумены такие как NetworkManager или systemd-networkd для настройки сети network

Поддержка Bluetooth

Настройте Bluetooth с помощью blueman или других похожих утилит.

Power Management

Настройте laptop battery management, сон, и гибернацию с такими инструментами как tlp или systemd сервисом.

Печать и скан

Включите Cups для поддержки принтера и инструментов типа Sane для сканеров.

Советы и рекомендации

Модулизация вашей конфигурации с помощью модулей

См. Также