NixOS is a Linux distribution based on the Nix package manager.
Getting Started
NixOS is a Linux distribution based on the Nix package manager.
services-flake provides declarative, composable, and reproducible services for Nix development environment, and is based on flake-parts. Enabling users to have NixOS-like service on macOS and Linux.
nixpkgs (https://github.com/NixOS/nixpkgs) is a monorepo containing a collection of Nix packages. It also includes various utility Nix functions (like writeShellApplication
), as well as the NixOS Linux distribution (including the Module System).
nix-darwin brings NixOS like configuration to macOS, allowing you to install packages (among doing other things) purely through Nix.
If you’ve ever used NixOS before, you might be familiar with the way services are managed. Let’s take a quick look at an example to understand if that will help us arrive at a solution for our problem.
In the last section, we saw how easy it is to run services in NixOS. We are looking for something similar for our development environment that runs across platforms. Additionally, the solution should:
Running services in NixOS is a breeze. For example, running a PostgreSQL Database is as simple as adding one line to your configuration:
Choose from one of the following ways to install NixOS:
The Linux distro NixOS comes with Nix pre-installed. You can Install Nix manually on other platforms.
NixOS makes use of the module system to provide various functionality including services and programs. See https://search.nixos.org/options for a list of all available options.
Whethere you are on macOS or NixOS, you can install and setup fonts in an unified fashion with Nix using home-manager.
disko
disk partitioning
In this second tutorial, we will walk you through the process of installing NixOS. Unlike the first installation tutorial, we will use the command line to install NixOS manually, except for using disko to specify disk partitions declaratively in Nix itself. This is the first step toward our next tutorial, where we will automate the entire installation process.
The above downloaded Nix file uses a hardcoded disk device. So, we need to replace it with the device name of the disk we want to install NixOS on. We can use lsblk
to find it.