configuration.nix by Example

Your configuration.nix is a module. It defines some of the options declared in modules elsewhere, usually for the most part ones in <nixpkgs/nixos/modules>. You can search for information about these options on this page.

When you alter your configuration, you can type nixos-rebuild switch to switch to it and make it the new default. You can also check the NixOS Commands page for different ways to use nixos-rebuild.

What follows are some example configurations to hopefully give you some helpful context for how NixOS modules are configured.

see also NixOS Manual: Chapter 5. Configuration Syntax