Declarative hardware configuration for NixOS [maintainer=@brianmcgee,@Mic92] https://nix-community.github.io/nixos-facter/
Find a file
2025-12-30 04:11:45 +00:00
.github chore(deps): bump actions/checkout from 5 to 6 2025-11-24 15:08:54 +00:00
cmd fix: update golangci-lint config to version 2 2025-07-07 18:01:19 +01:00
docs README: deprecated old NixOS module 2025-12-23 14:56:15 +00:00
nix release: v0.4.3 2025-12-30 04:09:35 +00:00
pkg hwinfo: add BusHost support for integrated devices 2025-12-23 16:48:54 +00:00
scripts create-release: check version format and drop flake check 2025-12-30 04:05:59 +00:00
.envrc feat: add mkdocs site with initial content 2024-09-06 17:08:31 +01:00
.gitignore feat: add mkdocs site with initial content 2024-09-06 17:08:31 +01:00
.golangci.yml fix: update golangci-lint config to version 2 2025-07-07 18:01:19 +01:00
.mergify.yml mergify: fix queuing conditions 2024-12-26 19:58:27 +01:00
flake.lock Update flake input: nixpkgs 2025-12-30 03:28:06 +00:00
flake.nix devshell: add macos support 2025-12-23 16:40:49 +00:00
go.mod chore(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.1 2025-11-04 16:43:13 +00:00
go.sum chore(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.1 2025-11-04 16:43:13 +00:00
LICENSE feat: switch to GPLv3 license 2024-07-29 13:43:47 +00:00
main.go doc: remove auto-generated copyright header 2024-09-09 12:08:55 +01:00
mkdocs.yml Change user-facing URLs to nix-community 2025-07-09 17:09:17 +02:00
README.md README: deprecated old NixOS module 2025-12-23 14:56:15 +00:00
renovate.json renovate: enable nix 2024-07-25 12:48:36 +02:00

NixOS Facter

NixOS Facter aims to be an alternative to projects such as NixOS Hardware and nixos-generate-config. It solves the problem of bootstrapping NixOS configurations by deferring decisions about hardware and other aspects of the target platform to NixOS modules.

We do this by first generating a machine-readable report (JSON) which captures detailed information about the machine or virtual environment it was executed within.

This report is then passed to a series of NixOS modules which can make a variety of decisions, some simple, some more complex, enabling things like automatic configuration of network controllers or graphics cards, USB devices, and so on.

Project Structure

This repository contains the binary for generating the report.

The NixOS modules for making use of the report are included in nixpkgs. See the NixOS options documentation for details.

For more information, please see the docs.

Quick Start

To generate a report using nixos-facter from nixpkgs:

# you must run this as root
 sudo nix run --option experimental-features "nix-command flakes" nixpkgs#nixos-facter -- -o facter.json

To use the latest development version from this flake:

# you must run this as root
 sudo nix run \
  --option experimental-features "nix-command flakes" \
  --option extra-substituters https://numtide.cachix.org \
  --option extra-trusted-public-keys numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE= \
  github:nix-community/nixos-facter -- -o facter.json

Contributing

Contributions are always welcome!

License

This software is provided free under GNU GPL v3.


This project is supported by Clan and Numtide.

Clan

Clan is a peer-to-peer management framework based on NixOS that has:

  • a uniform interface
  • automated secret management
  • automated service setup
  • automated backups
  • peer-to-peer Mesh VPN

Get in touch and learn more at:

Numtide

Numtide Logo

Were a team of independent freelancers that love open source. We help our customers make their project lifecycles more efficient by:

  • Providing and supporting useful tools such as this one.
  • Building and deploying infrastructure, and offering dedicated DevOps support.
  • Building their in-house Nix skills, and integrating Nix with their workflows.
  • Developing additional features and tools.
  • Carrying out custom research and development.

Contact us if you have a project in mind, or if you need help with any of our supported tools, including this one.

We'd love to hear from you.