A series of NixOS modules to be used in conjunction with https://github.com/nix-community/nixos-facter [maintainer=@brianmcgee,@Mic92] https://nix-community.github.io/nixos-facter-modules/
Find a file
2025-12-24 06:35:41 +00:00
.github ci(deps): bump cachix/install-nix-action from 31.8.4 to 31.9.0 2025-12-15 04:24:09 +00:00
dev reformat after flake update 2025-10-09 14:36:29 +01:00
docs reformat after flake update 2025-10-09 14:36:29 +01:00
hosts/basic feat: improve NixOS Options reference generation 2024-09-12 11:39:27 +01:00
lib feat: Enable intel-ipu6 support if a matching camera is detected 2025-08-18 20:46:16 +02:00
modules/nixos fix(amd): set correct driver 2025-12-10 13:39:12 -03:00
.envrc feat: reload devshell when private dev flake has changed 2024-09-11 14:42:55 +01:00
.gitignore Add .direnv to .gitignore 2024-09-25 11:22:48 +02:00
.mergify.yml chore: fmt 2024-11-22 15:15:25 +00:00
devshell.nix use flake-compat instead of privateFlake 2025-10-09 14:35:11 +01:00
docs.nix chore: fmt 2024-11-04 10:19:58 +00:00
flake.lock get rid of nixpkgs as well 2024-09-03 12:26:03 +02:00
flake.nix don't export formatter on riscv64 2025-10-09 14:47:56 +01:00
formatter.nix Merge pull request #53 from britter/mandatory-formatting 2024-11-04 14:22:10 +01:00
LICENSE feat: initial import 2024-07-25 11:33:46 +01:00
mkdocs.yml feat: bootstrap docs 2024-09-11 16:06:00 +01:00
private.narHash get rid of nixpkgs as well 2024-09-03 12:26:03 +02:00
README.md docs: fix typo 2025-12-24 12:06:54 +11:00
renovate.json chore: fmt 2024-11-04 10:19:58 +00:00

nixos-facter-modules

Warning

This repository is deprecated. The modules have been upstreamed to nixpkgs. Please use the nixpkgs version instead:

{
  hardware.facter.reportPath = ./facter.json;
}

See the nixpkgs documentation for more details.


A series of NixOS modules to be used in conjunction with NixOS Facter.

With a similar goal to NixOS Hardware, these modules are designed around fine-grained feature detection as opposed to system models. This is made possible by the hardware report provided by NixOS Facter.

By default, these modules enable or disable themselves based on detected hardware.

For more information, see the docs.

Getting started

To generate a hardware report run the following:

$ nix --extra-experimental-features "flakes nix-command" run github:nix-community/nixos-facter > facter.json

Then use the generated facter.json with the NixOS module as follows:

NixOS with flakes

We are currently assuming that a the system uses disko, so we have not implemented fileSystems configuration. If you don't use disko, you have to currently specify that part of the configuration yourself or take it from nixos-generate-config.

# flake.nix
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    nixos-facter-modules.url = "github:nix-community/nixos-facter-modules";
  };

  outputs =
    inputs@{ nixpkgs, ... }:
    {
      nixosConfigurations.basic = nixpkgs.lib.nixosSystem {

        modules = [
          inputs.nixos-facter-modules.nixosModules.facter
          { config.facter.reportPath = ./facter.json; }
          # If you want to test out nixos-facter, you can add these dummy
          # values to make the configuration valid. Note that this likely won't boot if
          # it doesn't match your own partitioning
          # {
          #   users.users.root.initialPassword = "fnord23";
          #   boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ];
          #   fileSystems."/".device = lib.mkDefault "/dev/sda";
          # }
          # ...
          ## You also need to define your bootloader if you are not using grub
          #{ boot.loader.systemd-boot.enable = true; }
        ];
      };
    };
}

Non-flakes NixOS

# configuration.nix
{
  imports = [
    "${
      (builtins.fetchTarball { url = "https://github.com/nix-community/nixos-facter-modules/"; })
    }/modules/nixos/facter.nix"
  ];

  config.facter.reportPath = ./facter.json;
}