2026-04-06 22:40:40 +01:00
2026-03-23 21:32:14 +00:00
2026-03-18 17:08:24 +00:00
2026-04-06 17:52:15 +01:00
2026-03-23 21:32:14 +00:00
2026-04-05 22:47:17 +01:00
2026-04-06 22:40:40 +01:00
2026-03-08 00:25:16 +00:00
2026-03-14 10:43:47 +00:00
2026-04-06 20:07:34 +01:00
2026-03-20 19:26:48 +00:00
2026-03-13 19:32:32 +00:00
2026-02-28 17:33:09 +00:00

NixOS Configuration

This repository contains the declarative NixOS configuration for my machines, utilizing Flakes, Home Manager, and Disko for dynamic, multi-host deployment.

Hardware Configuration Generation

When setting up a new host, or updating an existing one, you'll need to generate a hardware-specific configuration file so NixOS knows what kernel modules and microcode to load for your exact components.

To generate the hardware configuration, run the following command directly on the target machine:

# Replace 'hostname' with the name of your machine (e.g., 'station' or 'stationette')
# We use 'nix shell' since the nixos-install-tools package doesn't have a default executable.
sudo $(which nix) --extra-experimental-features "nix-command flakes" shell nixpkgs#nixos-install-tools -c nixos-generate-config --no-filesystems --show-hardware-config --dir . > hardware/<hostname>-hardware-configuration.nix

Ensure this file is tracked by git before attempting to evaluate or build the flake:

git add hardware/<hostname>-hardware-configuration.nix

Installation

This configuration uses Disko to manage declarative disk partitioning and formatting. The disk layouts are defined in hardware/disko.nix.

Warning

Running the Disko installation commands below will completely erase the target disks. Ensure you have backups of any important data before proceeding.

Method 1: Installing Directly from Gitea (Remote)

You can install NixOS directly from this repository without needing to clone it manually first. Boot into a NixOS live USB, open a terminal, and run the following command.

Replace <hostname> with your target machine (e.g., stationette) and <disk> with the target block device (e.g., /dev/sda or /dev/nvme0n1):

nix --extra-experimental-features "nix-command flakes" run github:nix-community/disko/latest#disko-install -- \
  --flake git+https://labs.scarif.space/chris/nixos/#<hostname> \
  --disk <hostname> \
  --write-efi-boot-entries <disk>

Examples:

For stationette:

nix --extra-experimental-features "nix-command flakes" run github:nix-community/disko/latest#disko-install -- \
  --flake git+https://labs.scarif.space/chris/nixos/#stationette \
  --disk stationette \
  --write-efi-boot-entries /dev/sda

For station:

nix --extra-experimental-features "nix-command flakes" run github:nix-community/disko/latest#disko-install -- \
  --flake git+https://labs.scarif.space/chris/nixos/#station \
  --disk station \
  --write-efi-boot-entries /dev/nvme0n1

Method 2: Installing from a Local Clone

If you prefer to clone the repository first so you can make manual adjustments (like generating the hardware configuration) before deploying:

  1. Boot into a NixOS live USB.
  2. Clone the repository:
    git clone https://labs.scarif.space/chris/nixos.git /mnt/etc/nixos
    cd /mnt/etc/nixos
    
  3. Generate your hardware configuration (if needed):
    nixos-generate-config --no-filesystems --show-hardware-config > hardware/<hostname>-hardware-configuration.nix
    git add hardware/<hostname>-hardware-configuration.nix
    
  4. Run the Disko installer using the local flake:
    nix --extra-experimental-features "nix-command flakes" run github:nix-community/disko/latest#disko-install -- \
      --flake .#<hostname> \
      --disk <hostname> \
      --write-efi-boot-entries <disk>
    

(Remember to replace <hostname> and <disk> with your specific machine's details, e.g., .m#stationette and /dev/sda).


Rebuilding the System

Once installed and booted into your new system, you can pull the latest changes and apply updates using standard NixOS rebuild commands:

sudo nixos-rebuild switch --flake .#<hostname>
Description
No description provided
Readme 553 KiB
Languages
Nix 99.9%
Shell 0.1%