nixpkgs/pkgs/build-support
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
..
add-opengl-runpath
agda Merge pull request #98214 from turion/dev_test_all_agda_packages 2021-10-19 09:56:50 +02:00
alternatives lapack: include lapacke_utils.h in alternatives/lapack 2021-12-01 15:14:47 +08:00
appimage Merge staging-next into staging 2021-10-29 18:01:38 +00:00
bintools-wrapper Check link type based on expanded parameters 2022-01-01 20:30:56 +08:00
build-bazel-package buildBazelPackage: Pass --curses=no for terse logs 2021-12-04 23:36:40 +00:00
build-dotnet-module buildDotnetModule: wrap executables in preFixup 2022-01-12 00:23:53 +01:00
build-dotnet-package buildDotnetPackage: rename baseName to pname 2021-12-23 22:46:35 +01:00
build-fhs-userenv maintainers: update personal details 2021-12-31 21:48:55 +03:00
build-fhs-userenv-bubblewrap Merge pull request #145258 from Ma27/steam-resolv-conf-override 2022-01-18 22:59:08 +01:00
build-graalvm-native-image buildGraalVmNativeImage: enable utf-8 by default 2022-01-04 09:56:34 +01:00
build-setupcfg
buildenv lib: make extendDerivation lighter on eval 2021-10-15 16:39:10 +02:00
cc-wrapper Check link type based on expanded parameters 2022-01-01 20:30:56 +08:00
coq coqPackages.mkCoqDerivation: rely on namePrefix to compute default opam-name 2021-09-20 11:10:23 +02:00
dhall dhallDirectoryToNix: add this utility function 2021-12-07 13:36:21 +09:00
docker nixos/tests/docker-tools: add test for pre-runAsRoot layer unpack order 2021-12-17 19:26:53 -06:00
dotnetbuildhelpers treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix 2021-01-19 01:16:25 -08:00
dotnetenv treewide: stdenv.lib -> lib 2021-01-24 01:49:49 +01:00
emacs melpa2nix: Ignore large file warnings 2021-12-19 08:07:18 -08:00
expand-response-params responsie file logic 2021-02-09 09:46:47 +08:00
fetchbitbucket fetchFromBitbucket: remove hack for Mercurial 2021-02-08 17:54:12 +00:00
fetchbower
fetchbzr treewide: editorconfig fixes 2021-01-20 09:11:11 +10:00
fetchcvs fetchcvs: fix ssh wrapper failing due to missing /usr/bin/env 2021-02-08 19:18:17 +01:00
fetchdarcs
fetchdocker fix: fetchdocker call signature 2021-05-08 23:57:32 +02:00
fetchfirefoxaddon fetchfirefoxaddon: Allow overriding the src and add a test for it 2021-10-03 03:43:41 +03:00
fetchfossil
fetchgit fetchgit: Add test for sparseCheckout 2022-01-24 11:23:56 +08:00
fetchgitea fetchFromGitea: init 2021-05-27 09:35:56 +02:00
fetchgithub fetchgithub: Support sparseCheckout 2022-01-24 11:31:41 +08:00
fetchgitiles
fetchgitlab fetchgitlab: fix unexpected argument 2021-11-18 21:53:46 +03:00
fetchgitlocal
fetchgx fetchgx: deprecate phases 2021-08-20 23:47:21 +02:00
fetchhg treewide: stdenvNoCC.lib -> lib 2021-01-27 13:01:51 +07:00
fetchipfs
fetchmavenartifact treewide: stdenv.lib -> lib 2021-01-24 01:49:49 +01:00
fetchmtn misc: Replace tab indentation with spaces 2021-11-14 16:04:46 +13:00
fetchnextcloudapp nixos/nextcloud: fixup #119638 2021-10-09 22:45:31 +02:00
fetchnuget buildDotnetPackage: rename baseName to pname 2021-12-23 22:46:35 +01:00
fetchpatch patchutils: add 0.4.2 variant + remove meta.executable + enable tests + fix inter-dependencies by wrapping (#141567) 2021-10-25 13:13:22 +03:00
fetchrepoorcz
fetchrepoproject treewide: stdenvNoCC.lib -> lib 2021-01-27 13:01:51 +07:00
fetchs3 treewide: remove stdenv where not needed 2021-03-04 19:54:50 +07:00
fetchsavannah
fetchsourcehut fetchFromSourcehut: allow recursive fetching 2022-01-03 16:37:16 +07:00
fetchsvn treewide: stdenvNoCC.lib -> lib 2021-01-27 13:01:51 +07:00
fetchsvnrevision
fetchsvnssh
fetchurl fetchurl: also check certificate when using all zero hash (#152608) 2022-01-02 13:01:17 +01:00
fetchzip fetchzip: recursively run chmod +w on the unpackDir 2021-09-08 03:58:18 +03:00
go garble: mark as broken on darwin 2022-01-03 18:53:54 -05:00
icon-conv-tools application/development: /s/name/pname&version/ 2021-06-30 09:55:22 +02:00
install-shell-files
java canonicalize-jars-hook: add 2021-10-27 13:21:27 +03:00
kernel make-initrd: fix #132059 2021-08-08 07:53:59 +02:00
libredirect libredirect: fix build for aarch64-darwin (PR #156460) 2022-01-24 12:20:51 +01:00
make-desktopitem build-support/make-desktopitem: add some missing fields 2021-06-04 17:48:46 +02:00
make-startupitem
make-symlinks
mkshell mkShell: make it buildable (#153194) 2022-01-08 01:54:04 +01:00
mono-dll-fixer mono-dll-fixer: remove builder.sh 2021-11-20 18:01:00 +01:00
nix-gitignore nix-gitignore: fix evaluation when .gitignore contains \# or \! (#130643) 2021-07-22 12:18:10 -04:00
node/fetch-yarn-deps fetchYarnDeps: support more url types 2021-12-30 11:13:25 +01:00
nuget-to-nix buildDotnetPackage: rename baseName to pname 2021-12-23 22:46:35 +01:00
nuke-references nukeReferences: fix code signatures on aarch64-darwin 2021-05-17 00:27:03 +09:00
ocaml buildOcaml: rename name to pname 2021-11-01 16:19:30 +01:00
oci-tools
pkg-config-wrapper pkg-config: make comment clearer for non-natives 2021-12-02 16:11:43 -08:00
prefer-remote-fetch
references-by-popularity
release releaseTools.antBuild: remove 2021-10-27 13:21:27 +03:00
remove-references-to removeReferencesTo: fix code signatures on aarch64-darwin 2021-05-17 00:27:03 +09:00
replace-secret replace-secret: deprecate phases 2021-08-17 09:59:37 +02:00
rust Merge master into staging-next 2022-01-20 00:01:46 +00:00
setup-hooks makeWrapper: Add --prefix-each flag (#145104) 2021-12-27 22:15:06 -08:00
singularity-tools singularity-tools.buildImage: fix building from non-standard store paths 2021-10-27 02:11:44 -04:00
skaware skawarePackages.buildPackage: reformat with nixpkgs-fmt 2022-01-15 22:06:56 +01:00
snap
src-only
substitute
substitute-files treewide: stdenv.lib -> lib 2021-01-24 01:49:49 +01:00
templaterpm nix-template-rpm: deprecate phases 2021-08-17 11:04:49 +02:00
trivial-builders nixos/nix-daemon: use structural settings 2022-01-26 21:04:50 -05:00
upstream-updater golly: 3.3 -> 4.1 2021-12-06 16:27:09 +01:00
vm vmTools/test: fix pcmanfm instead of pan 2021-12-31 16:47:22 +01:00
wrapper-common Quote variable references (#144838) 2021-11-09 19:55:40 +09:00
writers writers.PyPy{2,3}: init 2021-12-15 10:01:08 +01:00
build-maven.nix
build-pecl.nix php: Run nixpkgs-fmt on all php related files 2021-06-26 20:07:56 +02:00
closure-info.nix
plugins.nix treewide: remove stdenv where not needed 2021-01-25 18:31:47 +01:00
replace-dependency.nix
setup-systemd-units.nix setupSystemdUnits: use /nix/var/nix/profiles/default/lib/systemd/system as fallback 2021-02-12 12:53:20 +01:00
source-from-head-fun.nix
test-equal-derivation.nix testEqualDerivation: init 2022-01-08 15:18:57 +01:00
trivial-builders.nix Merge branch 'staging-next' into staging 2022-01-10 01:26:05 +01:00