nixpkgs/nixos/modules/security
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
..
acme nixos/acme: ensure web servers using certs can access them 2022-01-08 15:05:34 -05:00
apparmor apparmor: Fix cups-client typo 2021-08-23 00:50:15 -07:00
wrappers security/wrappers: remove C compiler from the nixos/security.wrappers AppArmor profile 2021-12-29 16:26:57 +01:00
apparmor.nix nixos/security/apparmor: utillinux -> util-linux 2021-05-17 17:14:08 +02:00
audit.nix nixos: Move uses of stdenv.shell to runtimeShell. 2018-03-01 14:38:53 -05:00
auditd.nix auditd service: make more useful 2019-06-10 18:55:11 +03:00
ca.nix nixos/ca: use cacert package build for options and p11-kit output 2021-10-08 01:21:57 +00:00
chromium-suid-sandbox.nix nixos: explicitely set security.wrappers ownership 2021-09-13 13:48:13 +02:00
dhparams.nix treewide: set defaultText for options using simple path defaults 2021-12-09 01:12:13 +01:00
doas.nix nixos/terminfo: inherit TERMINFO* env vars also for doas 2021-11-08 14:05:24 -08:00
duosec.nix nixos: explicitely set security.wrappers ownership 2021-09-13 13:48:13 +02:00
google_oslogin.nix nixos/google-oslogin: add to system.nssDatabases.group too 2020-05-11 16:14:50 +02:00
lock-kernel-modules.nix nixos/lock-kernel-modules: reorder before/after 2021-09-19 12:06:00 +02:00
misc.nix nixos/nix-daemon: use structural settings 2022-01-26 21:04:50 -05:00
oath.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
pam_mount.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
pam_usb.nix nixos: explicitely set security.wrappers ownership 2021-09-13 13:48:13 +02:00
pam.nix Merge master into staging-next 2022-01-12 12:01:06 +00:00
polkit.nix nixos: explicitely set security.wrappers ownership 2021-09-13 13:48:13 +02:00
rngd.nix nixos/rngd: Remove module entirely, leave an explaination 2021-02-21 01:32:50 +01:00
rtkit.nix nixos: define the primary group of users where needed 2021-09-12 14:59:30 +02:00
sudo.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
systemd-confinement.nix Move systemd-lib.nix and systemd-unit-options.nix into utils 2021-11-20 17:52:29 -05:00
tpm2.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00