Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nix-community/nixos-facter-modules
A series of NixOS modules to be used in conjunction with https://github.com/nix-community/nixos-facter [maintainer=@brianmcgee,@Mic92]]
https://github.com/nix-community/nixos-facter-modules
nix nix-community-buildbot nixos
Last synced: 5 days ago
JSON representation
A series of NixOS modules to be used in conjunction with https://github.com/nix-community/nixos-facter [maintainer=@brianmcgee,@Mic92]]
- Host: GitHub
- URL: https://github.com/nix-community/nixos-facter-modules
- Owner: nix-community
- License: mit
- Created: 2024-07-25T10:32:17.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-19T08:23:57.000Z (about 1 month ago)
- Last Synced: 2025-01-08T13:16:38.388Z (12 days ago)
- Topics: nix, nix-community-buildbot, nixos
- Language: Nix
- Homepage: https://nix-community.github.io/nixos-facter-modules/
- Size: 846 KB
- Stars: 74
- Watchers: 4
- Forks: 7
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - nix-community/nixos-facter-modules - A series of NixOS modules to be used in conjunction with https://github.com/nix-community/nixos-facter [maintainer=@brianmcgee,@Mic92]] (Nix)
README
# nixos-facter-modules
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].
[NixOS modules]: https://wiki.nixos.org/wiki/NixOS_modules
[NixOS Facter]: https://github.com/numtide/nixos-facter
[NixOS Hardware]: https://github.com/NixOS/nixos-hardware
[docs]: https://nix-community.github.io/nixos-facter-modules/## Getting started
To generate a hardware report run the following:
```console
$ nix --extra-experimental-features "flakes nix-command" run github:numtide/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](https://github.com/nix-community/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`.```nix
# flake.nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-facter-modules.url = "github:numtide/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
```nix
# configuration.nix
{
imports = [
"${
(builtins.fetchTarball { url = "https://github.com/numtide/nixos-facter-modules/"; })
}/modules/nixos/facter.nix"
];config.facter.reportPath = ./facter.json;
}
```