NixOS as a desktop: Difference between revisions
No edit summary |
Make this page worthy of being linked to from the front page, complete rewrite and restructuring |
||
| Line 2: | Line 2: | ||
<translate> | <translate> | ||
<!--T:1--> | <!--T:1--> | ||
NixOS | [[NixOS]] is a versatile operating system suitable for a wide range of use cases. This page is intended for users who wish to run NixOS as their primary desktop environment, either on physical hardware or within a virtual machine. Additionally, users planning to deploy NixOS in [[NixOS friendly hosters|cloud]] environments or on specialized server infrastructure may find it helpful to begin with the concepts and practices introduced here, as they provide a useful foundation for working within the broader [[Nix ecosystem]]. | ||
== Installation == <!--T:2--> | == Installation == <!--T:2--> | ||
<!--T:4--> | <!--T:4--> | ||
Refer to [[NixOS Installation Guide]] to get started. 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 [[:Category:Desktop environment|desktop environments]], [[:Category:Web Browser|web browsers]], and other [[:Category:Applications|graphical applications]], that would be typical of daily use. 15 GiB might be enough for a fairly bare-bones setup. | |||
== Managing your configuration == <!--T:7--> | == Managing your configuration == <!--T:7--> | ||
<!--T:8--> | <!--T:8--> | ||
As described in the [[Overview of the NixOS Linux distribution#Declarative Configuration]], NixOS is designed to be configured declaratively. This means the entire system configuration, including installed packages, system services, kernel parameters, and user accounts is defined in configuration files, typically in <code>/etc/nixos/configuration.nix</code>. These settings can then be applied consistently and reproducibly across machines. | |||
== | The process for managing your configuration is documented in the {{NixOS Manual|name=NixOS official manual|anchor=#ch-configuration}}. | ||
=== System Configuration === | |||
< | 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: | ||
= | <syntaxhighlight lang="console"> | ||
# nixos-rebuild switch | |||
</syntaxhighlight> | |||
=== | === 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 [https://nixos.org/manual/nixos/stable/#sec-changing-config configuration.nix]. | |||
Home Manager can be used independently of the system configuration and works with both traditional setups and newer [[Flakes]]-based configurations. | |||
=== With Flakes === <!--T:17--> | === With Flakes === <!--T:17--> | ||
<!--T:18--> | <!--T:18--> | ||
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 [[Flakes#NixOS configuration with flakes]] for details on getting started. | |||
== Beyond initial setup == <!--T:21--> | == Beyond initial setup == <!--T:21--> | ||
<!--T:22--> | <!--T:22--> | ||
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 [[Gnome|GDM]], [[KDE|SDDM]], or [[LightDM]]. | |||
==== Audio Setup ==== | |||
Enable and configure [[:Category:Audio|audio]] systems like [[PipeWire]], [[PulseAudio]], or [[ALSA]]. | |||
==== Network Management ==== | |||
Use tools such as [[NetworkManager]] or [[systemd-networkd]] for managing [[Networking|network]] connections. | |||
==== Bluetooth Support ==== | |||
Set up [[Bluetooth]] with blueman or other management tools. | |||
==== Power Management ==== | |||
Configure [[laptop]] [[Power Management|battery management]], suspend, and hibernation with tools like [[Laptop#tlp|tlp]] or [[systemd]] services. | |||
==== Printing and Scanning ==== | |||
Enable [[Cups]] for printer support and tools like Sane for [[Scanners|scanning]] devices. | |||
== Tips and tricks == <!--T:12--> | |||
=== Modularizing your configuration with modules === <!--T:13--> | |||
<!--T:14--> | |||
The <code>configuration.nix</code> file itself is an instance of a [[NixOS modules|NixOS module]], and the NixOS module system makes it straightforward to split your configuration into multiple files for better organization and reusability. Modules can: | |||
<!--T:15--> | |||
* Import other modules | |||
* Declare new configuration options | |||
* Provide values for existing options (this is what most of a standard configuration.nix does) | |||
* Reference option values from other modules (via the <code>config</code> attribute passed to all modules) | |||
<!--T:16--> | |||
By declaring options for any values you wish to share between modules, you can structure your configuration into as many files as you like, importing them directly or indirectly from your root <code>configuration.nix</code> file. This makes it easier to manage large or complex configurations by keeping related settings together. | |||
Additionally, you can import modules from remote sources if desired, for example using </code>builtins.fetchTarball</code> or similar functions, which is particularly useful for sharing configurations across multiple machines or pulling in reusable modules maintained elsewhere. | |||
Refer to [[NixOS modules]] page and {{NixOS Manual|name=NixOS Manual: Chapter - Package Management|anchor=#sec-writing-modules}} for more information on modules. | |||
<!--T: | == See also == <!--T:23--> | ||
<!--T: | <!--T:25--> | ||
* [[Overview of the NixOS Linux distribution]] | |||
* [https://github.com/topics/nix-flake nix-flake] | * [[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 | |||
[[Category:Desktop]] | [[Category:Desktop]] | ||
[[Category:Guide]] | [[Category:Guide]] | ||
[[Category:NixOS]] | |||
</translate> | </translate> | ||