NixOS as a desktop: Difference between revisions

imported>Nickbouwhuis
m my mistake. reading is hard
Rhendric (talk | contribs)
Line 25: Line 25:
== Modularizing your configuration ==
== Modularizing your configuration ==


If you want a more composable 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.
=== With NixOS Modules ===
configuration.nix is an instance of a [[NixOS modules|NixOS module]], which makes it easy to break your configuration into several files. Modules can:


=== Video guide ===
* 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 <code>config</code> 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 <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.
=== With Flakes ===
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.
==== Video guide ====
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.
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.