Nix language makes it hard?
As you have seen earlier, getting started with NixOS can be a little daunting, so here is a short description of what you need to do to get started. To initiate the whole process, you must boot your machine from an ISO file. In a virtual machine, this is a standard way to install your operating system. The ISO is available from https://nixos.org/download.html, you have several options for download. If you are willing to read through this description, you should take the minimal version. This will give you a command line only environment to install from.
You can setup your system with graphics, KDE, GNOME etc. but the installer uses CLI. Your system will need to have a drive to install to, mount it to '/mnt', assuming you have done this, you can now find you entire configuration in '/mnt/etc/nixos/configuration.nix', except for the hardware configuration.
This is the file you need to have a grasp on what it contains.
The standard configuration always start with curly brackets that contain the words 'config' and then 'pkgs' and last three dots (...). These can change for special systems. When you know what to use them for, you have come farther than using this tutorial.
In the meantime, you can use the options search to find out how to set your system up. The whole file is a list of key value pairs, though you can use nesting to save typing.
https://search.nixos.org/options?channel=20.09&show=programs.sway.wrapperFeatures&from=0&size=50&sort=relevance&query=sway
The options you have immediately in the file follows standards as expected. GRUB config is set automatically by the script like below. This code is for BIOS.
boot.loader.grub.enable = true;
boot.loader.grub.verson = 2;
boot.loader.grub.useOsProber = true;
boot.loader.grub.device = "/dev/sda";
Most likely, you have UEFI. The code is then different.
boot.loader.grub = {
enable = true;
verson = 2;
efiSupport = true;
};
You can see an example how you nest variables that are under the same branch in the namespace. Use this technique to save on text and make it easier to read the configuration. Here is another example to set the time zone.
time = {
timeZone = "Europe/Stockholm";
hardwareClockInLocalTime = True;
};
The hardware clock in local time might be useful when dualbooting because Windows, by default, assumes the hardware clock is in local time.
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "uk";
};
Finding the fonts is one of the big challenges but you can download more from the NixOS Package site.
If you think it will be more convenient, you can split everything in many files, just like the hardware configuration file from the default file.
#+begin_src
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
#+end_src
Any file you want to tweak separately, or maybe share, you can put as a separate file and add as an import file.
More pieces of this file next week!