4 ms·
You don't need to write Nix configs for everything. With the following NixOS config, you can write raw configuration files and deploy them to /etc. # deplo
by soraminazuki 5y ago
You don't need to write Nix configs for everything. With the following NixOS config, you can write raw configuration files and deploy them to /etc.
# deploy ./config.txt to /etc/foo/config.txt
environment.etc."foo/config.txt" = ./config.txt;
You can do the same thing with Home Manager too.
However, many Nix users just tend to write Nix configs instead because it's easier. For one thing, NixOS modules provides high level options that's easier to work with than bare config files. The NixOS website has a good search UI for those options too [1]. Second, the Nix language is a nice language for writing configurations. It's JSON, but with functions, variables, and other niceties like indented multi-line strings and string interpolation. Writing everything in the Nix language allows you to share configuration values across different software with ease.
As for version control, I'm not sure what your issue is with Nix. Nix configuration files are just plain text files, so it can be version controlled like everything else. In fact, Nix flakes, the last topic of the article, is even designed to work best with version control.
[1]: https://search.nixos.org/options https://search.nixos.org/options