Jump to content

NixOS as a desktop/pt: Difference between revisions

From NixOS Wiki
Cybergui (talk | contribs)
Created page with "== Gerenciando sua configuração =="
FuzzyBot (talk | contribs)
Updating to match new version of source page
 
(21 intermediate revisions by one other user not shown)
Line 1: Line 1:
<languages/>
<languages/>
<div class="mw-translate-fuzzy">
O NixOS pode ser usado para diversas finalidades. Se você deseja usá-lo como sistema operacional de desktop principal para seu uso diário. Esta página é para você. Mesmo que sua ambição seja usar o NixOS na nuvem ou em servidores especialmente configurados, você pode começar com as lições descritas aqui para se familiarizar mais amplamente com o ecossistema Nix.
O NixOS pode ser usado para diversas finalidades. Se você deseja usá-lo como sistema operacional de desktop principal para seu uso diário. Esta página é para você. Mesmo que sua ambição seja usar o NixOS na nuvem ou em servidores especialmente configurados, você pode começar com as lições descritas aqui para se familiarizar mais amplamente com o ecossistema Nix.
</div>


<span id="Installation"></span>
<span id="Installation"></span>
== Instalação ==
== Instalação ==


<span id="Wiki_method"></span>
<div class="mw-translate-fuzzy">
=== Metodo Wiki ===
 
Se preferir ler, veja [[NixOS Installation Guide]] Para começar. Para uma opção de vídeo bem apresentada, veja a seção de guia de vídeo logo abaixo. Lembre-se de que, para uma instalação em desktop, você provavelmente precisará começar com pelo menos 30 GiB de espaço em disco disponível para os ambientes de desktop (por exemplo, GNOME, KDE ou XFCE), navegadores (por exemplo, Firefox) e outros aplicativos gráficos (por exemplo, VSCode) que seriam típicos de uso diário. 15 GiB podem ser suficientes para uma configuração bastante básica.
Se preferir ler, veja [[NixOS Installation Guide]] Para começar. Para uma opção de vídeo bem apresentada, veja a seção de guia de vídeo logo abaixo. Lembre-se de que, para uma instalação em desktop, você provavelmente precisará começar com pelo menos 30 GiB de espaço em disco disponível para os ambientes de desktop (por exemplo, GNOME, KDE ou XFCE), navegadores (por exemplo, Firefox) e outros aplicativos gráficos (por exemplo, VSCode) que seriam típicos de uso diário. 15 GiB podem ser suficientes para uma configuração bastante básica.
 
</div>
<span id="Video_guide"></span>
=== Guia em Video ===
 
Para um guia visual (video), veja [[Wil T Nix Guides]]. O [[Wil_T_Nix_Guides#NixOS_Installation_Guide|second video]] é um guia de instalação conciso. Esta série de 8 partes, produzida no início de 2021, também aborda todos os conceitos básicos de uso do NixOS como desktop e como configurá-lo conforme sua preferência.


<span id="Managing_your_configuration"></span>
<span id="Managing_your_configuration"></span>
== Gerenciando sua configuração ==
== Gerenciando sua configuração ==
<div class="mw-translate-fuzzy">
É possível gerenciar toda a sua configuração usando os métodos documentados no [https://nixos.org/manual/nixos/stable/index.html NixOS official manual]. No entanto, a maioria dos membros da comunidade que usam o NixOS no desktop preferem gerenciar suas configurações de usuário usando (e.g. "dotfiles") [[Home Manager]] (citação necessária). O Home Manager é uma ferramenta orientada ao usuário para declarar o que você deseja instalar e como deseja configurá-lo e, portanto, seria usado no lugar da maioria das configurações que você normalmente colocaria em um [https://nixos.org/manual/nixos/stable/#sec-changing-config configuration.nix] ou através [[FAQ#How_can_I_manage_software_with_nix-env_like_with_configuration.nix.3F|nix-env]]
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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]]
The process for managing your configuration is documented in the {{NixOS Manual|name=NixOS official manual|anchor=#ch-configuration}}.
</div>
</div>


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


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Wil T's guides are about an even mix of:
{{main|NixOS system configuration}}
# 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>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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.
The primary configuration file, <code>/etc/nixos/configuration.nix</code>, defines system-wide settings. This includes options like enabling services, managing system users, setting hardware options, and specifying installed packages. Changes are applied with:
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
== Modularizing your configuration ==
<syntaxhighlight lang="console">
# nixos-rebuild switch
</syntaxhighlight>
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
=== With NixOS Modules ===
=== User configuration with Home Manager ===
</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:
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 [https://nixos.org/manual/nixos/stable/#sec-changing-config configuration.nix].
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
* Import other modules
Home Manager can be used independently of the system configuration and works with both traditional setups and newer [[Flakes]]-based configurations.
* Declare new options
</div>
* 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)
<span id="With_Flakes"></span>
=== Com Flakes ===
 
<div class="mw-translate-fuzzy">
Se você quer uma composição de Configuração do NixOS, ainda experimental [[Flakes]] está causando muita excitação na comunidade. Gerenciar flocos requer um bom entendimento básico e alguma experiência prática com o ecossistema Nix.
</div>
</div>


<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.
Refer to [[NixOS system configuration#Defining NixOS as a flake]] for details on getting started.
</div>
 
<span id="Beyond_initial_setup"></span>
== Além da configuração inicial ==
 
<div class="mw-translate-fuzzy">
Depois de se familiarizar com o ecossistema Nix e ter uma instalação funcional do NixOS para desktop, você provavelmente se interessará por personalizações e configurações mais detalhadas.
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
=== With Flakes ===
Common configuration areas include:
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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.
==== Desktop Environments ====
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
==== Video guide ====
Install and configure full-featured environments such as [[GNOME]], [[KDE Plasma]], or [[Xfce]].
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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.
See [[:Category:Desktop environment]] for a full list.
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
== Beyond initial setup ==
==== Window Managers ====
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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.
Set up lightweight or tiling window managers like [[i3]], [[Sway]], [[Hyprland]], or [[xmonad]].
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
=== Learn by example ===
See [[:Category:Window managers]] for a full list.
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
If you are comfortable managing your system through a git repo using flakes, then there are many repositories you can learn from now!
==== Display Managers (Login Managers) ====
</div>  
</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.
Configure graphical session managers such as [[Gnome|GDM]], [[KDE|SDDM]], or [[LightDM]].
</div>
 
<div lang="en" dir="ltr" class="mw-content-ltr">
==== Audio Setup ====
</div>
</div>


<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.
Enable and configure [[:Category:Audio|audio]] systems like [[PipeWire]], [[PulseAudio]], or [[ALSA]].
</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.
==== Network Management ====
* [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>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Use tools such as [[NetworkManager]] or [[systemd-networkd]] for managing [[Networking|network]] connections.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
==== Bluetooth Support ====
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
Set up [[Bluetooth]] with blueman or other management tools.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
==== Power Management ====
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
Configure [[laptop]] [[Power Management|battery management]], suspend, and hibernation with tools like [[Laptop#tlp|tlp]] or [[systemd]] services.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
==== Printing and Scanning ====
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
Enable [[Cups]] for printer support and tools like Sane for [[Scanners|scanning]] devices.
</div>
<span id="Tips_and_tricks"></span>
<div class="mw-translate-fuzzy">
== Gerenciando sua configuração ==
</div>
<span id="Modularizing_your_configuration_with_modules"></span>
<div class="mw-translate-fuzzy">
=== Com os Modulos NixOS ===
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
{{main|NixOS system configuration#Modularizing your configuration with modules}}
</div>
<span id="See_also"></span>
<div class="mw-translate-fuzzy">
=== Aprenda com exemplos ===
</div>
<div class="mw-translate-fuzzy">
Confira [[Comparison of NixOS setups]] para uma tabela comparando algumas opções populares.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
[[Category:Desktop]]
[[Category:Desktop]]
[[Category:Guide]]
[[Category:Guide]]
[[Category:NixOS]]
</div>

Latest revision as of 21:06, 7 October 2025

O NixOS pode ser usado para diversas finalidades. Se você deseja usá-lo como sistema operacional de desktop principal para seu uso diário. Esta página é para você. Mesmo que sua ambição seja usar o NixOS na nuvem ou em servidores especialmente configurados, você pode começar com as lições descritas aqui para se familiarizar mais amplamente com o ecossistema Nix.

Instalação

Se preferir ler, veja NixOS Installation Guide Para começar. Para uma opção de vídeo bem apresentada, veja a seção de guia de vídeo logo abaixo. Lembre-se de que, para uma instalação em desktop, você provavelmente precisará começar com pelo menos 30 GiB de espaço em disco disponível para os ambientes de desktop (por exemplo, GNOME, KDE ou XFCE), navegadores (por exemplo, Firefox) e outros aplicativos gráficos (por exemplo, VSCode) que seriam típicos de uso diário. 15 GiB podem ser suficientes para uma configuração bastante básica.

Gerenciando sua configuração

É possível gerenciar toda a sua configuração usando os métodos documentados no NixOS official manual. No entanto, a maioria dos membros da comunidade que usam o NixOS no desktop preferem gerenciar suas configurações de usuário usando (e.g. "dotfiles") Home Manager (citação necessária). O Home Manager é uma ferramenta orientada ao usuário para declarar o que você deseja instalar e como deseja configurá-lo e, portanto, seria usado no lugar da maioria das configurações que você normalmente colocaria em um configuration.nix ou através 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.

Com Flakes

Se você quer uma composição de Configuração do NixOS, ainda experimental Flakes está causando muita excitação na comunidade. Gerenciar flocos requer um bom entendimento básico e alguma experiência prática com o ecossistema Nix.

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

Além da configuração inicial

Depois de se familiarizar com o ecossistema Nix e ter uma instalação funcional do NixOS para desktop, você provavelmente se interessará por personalizações e configurações mais detalhadas.

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.

Gerenciando sua configuração

Com os Modulos NixOS

Aprenda com exemplos

Confira Comparison of NixOS setups para uma tabela comparando algumas opções populares.