Configuration Basics
Welcome! 🎉 This page shows you how to tweak NixOS to fit your needs. No jargon, just plain steps.
Step‑by‑step guide
- Open the main configuration file with your favourite editor:
sudo nano /etc/nixos/configuration.nix - Add or change options. Here’s a tiny example you can copy‑paste:
{ config, pkgs, ... }: { # Enable the OpenSSH server services.openssh.enable = true; # Give your machine a friendly name networking.hostName = "my-nixos-machine"; # Install a simple package so you can test everything works environment.systemPackages = with pkgs; [ hello ]; } - Save the file and quit the editor (for
nano, press Ctrl + X, then Y, then Enter). - Rebuild the system so the changes take effect:
sudo nixos-rebuild switch - Verify! For the hostname example, run:
You should seehostnamemy-nixos-machine. If you installedhello, tryhelloin the terminal.