Jump to content

NixOS no desktop

From NixOS Wiki
Revision as of 20:25, 30 June 2025 by Cybergui (talk | contribs) (Created page with "== Gerenciando sua configuração ==")

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

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.

Guia em Video

Para um guia visual (video), veja Wil T Nix Guides. O 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.

Gerenciando sua configuração

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:

  1. Hands-on bootstrapping to get to being able to very capably manage your system using Home Manager, git versioning, and eventually Flakes.
  2. 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.