nixpkgs/nixos/modules/profiles
polykernel 4a9d9928dc nixos/nix-daemon: use structural settings
The `nix.*` options, apart from options for setting up the
daemon itself, currently provide a lot of setting mappings
for the Nix daemon configuration. The scope of the mapping yields
convience, but the line where an option is considered essential
is blurry. For instance, the `extra-sandbox-paths` mapping is
provided without its primary consumer, and the corresponding
`sandbox-paths` option is also not mapped.

The current system increases the maintenance burden as maintainers have to
closely follow upstream changes. In this case, there are two state versions
of Nix which have to be maintained collectively, with different options
avaliable.

This commit aims to following the standard outlined in RFC 42[1] to
implement a structural setting pattern. The Nix configuration is encoded
at its core as key-value pairs which maps nicely to attribute sets, making
it feasible to express in the Nix language itself. Some existing options are
kept such as `buildMachines` and `registry` which present a simplified interface
to managing the respective settings. The interface is exposed as `nix.settings`.

Legacy configurations are mapped to their corresponding options under `nix.settings`
for backwards compatibility.

Various options settings in other nixos modules and relevant tests have been
updated to use structural setting for consistency.

The generation and validation of the configration file has been modified to
use `writeTextFile` instead of `runCommand` for clarity. Note that validation
is now mandatory as strict checking of options has been pushed down to the
derivation level due to freeformType consuming unmatched options. Furthermore,
validation can not occur when cross-compiling due to current limitations.

A new option `publicHostKey` was added to the `buildMachines`
submodule corresponding to the base64 encoded public host key settings
exposed in the builder syntax. The build machine generation was subsequently
rewritten to use `concatStringsSep` for better performance by grouping
concatenations.

[1] - https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
2022-01-26 21:04:50 -05:00
..
all-hardware.nix all-hardware: Add virtio_mmio module 2022-01-06 17:23:10 -08:00
base.nix profiles/base: add mtools 2021-11-17 00:26:31 +02:00
clone-config.nix ova: add cloneConfigExtra option 2018-10-21 14:52:49 -05:00
demo.nix nixos/displayManager: make autoLogin options independent of DM type 2020-07-09 21:15:35 -04:00
docker-container.nix docker-container: Remove /etc symlink 2019-11-27 15:51:19 -06:00
graphical.nix nixos/plasma5: drop enableQt4Support option 2019-11-22 09:01:05 +01:00
hardened.nix nixos/nix-daemon: use structural settings 2022-01-26 21:04:50 -05:00
headless.nix NixOS AWS AMI: enable the serial console on ttyS0 2021-08-20 12:42:02 -04:00
installation-device.nix nixos/installer: simplify and document wifi setup 2021-08-15 12:08:32 +02:00
minimal.nix nixos/profiles/minimal: disable command-not-found 2021-11-16 18:27:38 +02:00
qemu-guest.nix qemu-guest: remove security.rngd setting 2021-01-27 18:27:34 +01:00