Simple guide to NixOS?

Looking for a basic beginners guide to NixOS for a desktop user. I am not a programmer, just a Linux home user and distro-hopper.
Just some basics, like installing and removing packages, updating system, handling that magic config file, and reverting the system if necessary. And anything else essential that I neglected to mention…

or/and

https://nix.dev

get yourself to a user group

https://nix.ug

or start one with a PR!

and

come hang out in the mountains.

https://nix.camp

I also forgot the to mention the nix manual… doh!

https://nixos.org/manual/nix/stable/

2 Likes

:point_up: For NixOS in particular (excluding standalone Nix the package manager), this is pretty much how you do everything.

install packages:
{
    environment.systemPackages = [ pkgs.coreutils pkgs.zlib ];
}
updating system:

nix flake lock --update-input nixpkgs (assumes you use a flake to manage your config)

Even if you are not a programming, you are gonna wanna track your configuration in git most likely, if you know how to use it even a little. That will allow you to roll back to most any point in your commit history.

As far as rolling back a mistake, NixOS will automatically keep your previous system closures as startup items in your boot loader. So you can revert directly from a boot menu if you boot into a broken system.

In a pinch (if you have done something dumb like clear all your generations before a breaking update :sweat_smile:) you can use your git repository to restore your system from a commit that was previously known to work.

There is also simply the NixOS manual itself:
https://nixos.org/manual/nix/stable/

+1 on the NixOS manual. The very first sections that follow “Installation” are “Configuration Syntax” and “Package Management” - exactly what you asked for. Although then it follows with a bunch of docs dedicated to configuring particular software packages, later sections are more universally useful again, e.g. Rolling Back Configuration Changes.

1 Like