Skip to main content

NixOS Setup and Configuration Notes

·184 words·1 min
[Your Name]
Author
[Your Name]
Capturing light with Sony A7R2, building workflows with NixOS & Emacs, exploring LLMs and Agents.
Table of Contents
NixOS Toolchain - This article is part of a series.
Part 1: This Article

NixOS is a Linux distribution built on top of the Nix package manager, known for its declarative configuration and reproducibility.

This post documents my journey of installing and configuring NixOS from scratch.

Preparation
#

  • Download the NixOS minimal ISO
  • Create a bootable USB (I used dd)
  • Back up your data (important!)

Partitioning and Installation
#

# List disks
lsblk

# Partition (using /dev/nvme0n1 as example)
parted /dev/nvme0n1 -- mklabel gpt
parted /dev/nvme0n1 -- mkpart primary 512MiB -8GiB
parted /dev/nvme0n1 -- mkpart primary linux-swap -8GiB 100%

# Format
mkfs.ext4 -L nixos /dev/nvme0n1p1
mkswap -L swap /dev/nvme0n1p2

configuration.nix
#

Here’s my basic configuration:

{ config, pkgs, ... }:

{
  imports = [ ./hardware-configuration.nix ];

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  networking.hostName = "nixos-desktop";
  time.timeZone = "Asia/Shanghai";

  i18n.defaultLocale = "en_US.UTF-8";

  users.users.yourname = {
    isNormalUser = true;
    extraGroups = [ "wheel" "networkmanager" ];
    packages = with pkgs; [ firefox git ];
  };

  environment.systemPackages = with pkgs; [
    vim
    wget
    git
  ];

  system.stateVersion = "24.11";
}

Next Steps
#

  • Migrate to Flakes
  • Configure Home Manager
  • Set up devShells
  • Remote build cache

Configuration is a work in progress. Feedback welcome.

NixOS Toolchain - This article is part of a series.
Part 1: This Article