How to make changes to a NixOS configuration

Editing the configuration file

To edit the configuration file vim, will be used because it was installed during the installation process. However nano is also available by default, for those not familiar with vim.

The chanegs that will be made here will be to install git, git-crypt, gpg and home-manager. Previously only vim was installed, just edit that line to add the new packages.

vim /etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
  # Etcetera ...

  environment.systemPackages = with pkgs; [
    git
    git-crypt
    gpg
    home-manager
    # Etcetera ...
  ];

  # Etcetera ...
}

To apply the changes to the system configuration:

nixos-rebuild switch