Establishing the hardware section in configuration.nix

New to the communiity here, I’ve read the NixOS language doc. I can follow along. But to demonstrate the syntax of the nix language, the authors use basic variables and arithmatic. I personally find it ambiguous to interpolate 1 into a and b and then sum them together to make 2. I can’t imagine using that operation very frequently in production NixOS environments.

I know where to place the hardware configuration inside /etc/nixos/configuration.nix - - but where can I learn or read more about what to fill in here to make sure NixOS is configured to recognize my Intel CPU and AMD GPU and my integrated NIC on my Asus mobo?

I would have thought that with Linux in general handles CPU/GPU/mobo drivers are configured natively within the kernel - - the hardware should just work when booting the NixOS iso on live media like USB.

An annotated sample configuration.nix demonstrating common and not so common hardware configurations in production environments I think could be instructive. Can someone direct me to a doc which explains that?

I personally find it ambiguous to interpolate 1 into a and b and then sum them together to make 2 . I can’t imagine using that operation very frequently in production NixOS environments.

Nix is not really a general purpose language, but it’s not used exclusively for writing system configurations either. For example, for your shiny declarative configuration to be actually useful, someone had to implement what every option does and the implementation is written in Nix. The kernel and every software you installed was configured, built and packaged by writing recipes in Nix.

I know where to place the hardware configuration inside /etc/nixos/configuration.nix - - but where can I learn or read more about what to fill in here to make sure NixOS is configured to recognize my Intel CPU and AMD GPU and my integrated NIC on my Asus mobo?

Unless you’ve an interest in learning how NixOS works, you’re not supposed to care. If you use nixos-generate-config to bootstrap your configuration and have a desktop PC you’re ok.

For special (read troublesome) hardware like handeld devices, SBCs and some laptops you may want to look at nixos-hardware, which has more fine-tuned configurations.