Skip to content

Fix NixOS container build failing with missing hardware-configuration.nix #335

@paralin

Description

@paralin

Problem

The NixOS core container build is currently failing during the Docker image build process with the following error:

error: path '/home/builder/sys-config/hardware-configuration.nix' does not exist

This occurs at step 14/25 of the Dockerfile when running nixos-setup.sh.

Context

From issue #330, user @senpro-ingwersenk reported this issue when testing the updated docker-nixos repository (version 25.05) on Raspberry Pi 5.

The build process attempts to use nix-build '<nixpkgs/nixos>' -A system -I nixos-config=configuration.nix but the configuration references a hardware-configuration.nix file that doesn't exist in the build context.

Steps to Reproduce

  1. Configure SkiffOS: export SKIFF_CONFIG=pi/5,core/nixos
  2. Build: make configure compile
  3. Flash to SD card and boot Raspberry Pi 5
  4. Observe the build failure in journal logs: journalctl -D ./skiff/journal

Expected Behavior

The NixOS container should build successfully on first boot, providing a working NixOS environment.

Related Work

Potential Solutions

  1. Generate a minimal hardware-configuration.nix during the build process
  2. Remove the hardware-configuration.nix import from configuration.nix since this is a containerized environment
  3. Use the docker-image.nix module approach as suggested in Feedback and questions #330 discussion

Priority

High - This is blocking users from using NixOS core containers on any platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions