Commit Graph

15 Commits

Author SHA1 Message Date
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
Guillaume Girol
6f2ed3cd1e nixosTests.os-prober: fix infinite recursion 2021-12-09 12:00:00 +00:00
Sandro Jäckel
8547db919a
treewide: switch `builtins.fromJSON(builtins.readFile ./file.json)` to lib.importJSON ./file.json 2021-11-03 14:43:52 +01:00
Michael Weiss
c6325c8325
nixos/tests: Replace QEMU_OPTS usages with virtualisation.qemu.options
See [0]: "QEMU_OPTS is something that should be set by people running VM
tests interactively, to do port forwardings etc.
We really should not poke with it from the test script - that's what
virtualisation.qemu.options is for."

[0]: https://github.com/NixOS/nixpkgs/pull/119615#discussion_r624145020

Co-authored-by: Florian Klink <flokli@flokli.de>
2021-05-01 20:20:29 +02:00
Graham Christensen
bc49a0815a
utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
Symphorien Gibol
ddbd436dc4 nixos/tests/os-prober.nix: port to python 2020-08-24 17:49:20 +02:00
Symphorien Gibol
6a2f64a542 nixos/tests/os-prober.nix: fix out of memory 2020-03-29 15:30:33 +02:00
Franz Pletz
ec6224b6cd Revert "installer: Disable udisks"
This reverts commit 571fb74f44.

The dependency on gtk2 was removed.

Co-authored-by: Florian Klink <flokli@flokli.de>
2019-10-16 20:31:24 -04:00
Symphorien Gibol
4cab05598c os-prober.tests: make the test stricter
os-prober should be able to probe unmounted filesystems
2019-07-21 15:40:06 +02:00
symphorien
d1ac443cca
nixos/tests/os-prober.nix: fix typo
Co-Authored-By: Léo Gaspard <github@leo.gaspard.ninja>
2019-06-09 19:18:30 +00:00
Symphorien Gibol
9a69fab1e3 nixos/tests/os-prober.nix: apply review suggestions 2019-06-09 21:16:53 +02:00
symphorien
04c9866b6e
nixos/tests/os-prober.nix: apply review suggestions
Co-Authored-By: Léo Gaspard <github@leo.gaspard.ninja>
2019-06-09 19:12:07 +00:00
symphorien
f452d640f0
nixos/tests/os-prober.nix: apply review suggestions
Co-Authored-By: Léo Gaspard <github@leo.gaspard.ninja>
2019-06-09 19:11:47 +00:00
Symphorien Gibol
9e06a61cf0 mention the os-prober test in pkgs.os-prober.passthru.tests 2019-06-09 20:26:05 +02:00
Symphorien Gibol
52184a7a62 nixos/tests: add a test for os-prober 2019-06-09 19:05:30 +02:00