numtide / nixos-facter

Declarative hardware configuration for NixOS [maintainer=@numtide]
https://numtide.github.io/nixos-facter/
Other
225 stars 6 forks source link
buildbot-numtide nix nixos

NixOS Facter

[!NOTE] Status: beta

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.

NixOS Facter Modules contains the necessary NixOS modules for making use of the report in a NixOS configuration.

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:numtide/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 Numtide.

Numtide Logo

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

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.