nixpkgs/nixos/modules/services/misc
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
..
sourcehut nixos/sourcehut: add missing defaultText, escape antiquotations 2021-12-29 20:12:03 +01:00
taskserver
airsonic.nix treewide: make option descriptions constants 2021-12-09 01:21:04 +01:00
ananicy.nix nixos/ananicy: apply cgroup workaround if v2 is enabled 2022-01-06 21:55:42 +02:00
ankisyncd.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
apache-kafka.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
autofs.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
autorandr.nix treewide: remove gnidorah 2021-04-30 01:48:19 +02:00
bazarr.nix nixos/users: require one of users.users.name.{isSystemUser,isNormalUser} 2021-04-14 20:40:00 +02:00
beanstalkd.nix nixos/beanstalkd: add openFirewall option 2020-09-01 10:07:28 -04:00
bees.nix nixos/beesd: avoid royal we 2021-12-30 01:20:04 +00:00
bepasty.nix
calibre-server.nix nixos/calibre-server: Allow multiple libraries 2020-09-17 12:04:39 +02:00
canto-daemon.nix
cfdyndns.nix cfdyndns: fix startAt by setting it to *:0/5 instead of 5 minutes 2021-10-03 08:06:37 +03:00
cgminer.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
clipcat.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
clipmenu.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
confd.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
cpuminer-cryptonight.nix
dendrite.nix nixos/matrix-dendrite: rename to dendrite 2021-05-05 12:38:02 +02:00
devmon.nix
dictd.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
disnix.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
docker-registry.nix nixos: define the primary group of users where needed 2021-09-12 14:59:30 +02:00
domoticz.nix nixos/domoticz: use DynamicUser and StateDirectory 2020-10-11 11:15:56 +01:00
duckling.nix init duckling service 2021-04-27 10:41:07 -07:00
dwm-status.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
dysnomia.nix nixos/dysnomia: Type all options 2021-12-07 18:53:18 +01:00
errbot.nix
etcd.nix Merge pull request #148785 from pennae/more-option-doc-staticizing 2021-12-17 11:14:08 -05:00
etebase-server.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
etesync-dav.nix nixos/etesync-dav: init module 2021-02-17 10:43:08 +01:00
ethminer.nix
exhibitor.nix treewide: add defaultText for options with simple interpolation defaults 2021-12-09 01:13:48 +01:00
felix.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
freeswitch.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
fstrim.nix treewide: remove gnidorah 2021-04-30 01:48:19 +02:00
gammu-smsd.nix nixos/gammu-smsd: define group, fix after #133166 2021-09-18 14:42:08 +02:00
geoipupdate.nix nixos/geoipupdate: Add stricter service security 2021-06-07 14:19:57 +02:00
gitea.nix nixos/gitea: allow specifying dump format and name 2022-01-18 18:05:33 +01:00
gitit.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
gitlab.nix nixos/gitlab: Add additional paths to systemd.tmpfiles.rules 2022-01-25 19:05:49 +01:00
gitlab.xml nixos/gitlab: Document automatic backups 2021-03-30 19:15:33 +02:00
gitolite.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
gitweb.nix treewide: add literalDocBook text to options with complex defaults 2021-12-09 01:38:24 +01:00
gogs.nix treewide: add defaultText for options with simple interpolation defaults 2021-12-09 01:13:48 +01:00
gollum.nix nixos/gollum: Specify systemd WorkingDirectory 2021-10-31 13:37:00 +01:00
gpsd.nix nixos/gpsd: define group, fix after #133166 2021-09-18 14:42:08 +02:00
greenclip.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
headphones.nix treewide: add defaultText for options with simple interpolation defaults 2021-12-09 01:13:48 +01:00
heisenbridge.nix fixup! nixos/heisenbridge: Improve hardening 2022-01-13 23:33:23 +01:00
home-assistant.nix nixos/home-assistant: allow capset with components using ping command 2022-01-25 18:29:16 +01:00
ihaskell.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
irkerd.nix
jackett.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
jellyfin.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
klipper.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
leaps.nix nixos/leaps: use port type 2021-06-18 17:29:44 +02:00
libreddit.nix nixos/libreddit: init module and test 2021-04-19 01:05:25 +02:00
lidarr.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
lifecycled.nix nixos/lifecycled: init 2021-03-03 11:15:35 -08:00
logkeys.nix
mame.nix nixos: explicitely set security.wrappers ownership 2021-09-13 13:48:13 +02:00
matrix-appservice-discord.nix Merge pull request #148785 from pennae/more-option-doc-staticizing 2021-12-17 11:14:08 -05:00
matrix-appservice-irc.nix nixos/documentation: split options doc build 2022-01-02 19:46:13 +01:00
matrix-conduit.nix nixos/matrix-conduit: init 2022-01-03 15:36:56 +01:00
matrix-synapse-log_config.yaml
matrix-synapse.nix Merge pull request #155473 from yayayayaka/matrix-synapse-administration 2022-01-25 22:10:03 +01:00
matrix-synapse.xml nixos/services/matrix-synapse: fix eval errors in manual example 2021-04-16 18:13:42 +02:00
mautrix-facebook.nix nixos.mautrix-facebook: init module 2021-10-04 18:40:28 -04:00
mautrix-telegram.nix nixos/mautrix-telegram: run alembic only if available 2021-12-29 19:28:24 +01:00
mbpfan.nix nixos/mbpfan: convert to structural settings 2022-01-18 21:31:33 +03:00
mediatomb.nix treewide: add defaultText to remaining options 2021-12-09 01:42:24 +01:00
metabase.nix
moonraker.nix Merge pull request #148785 from pennae/more-option-doc-staticizing 2021-12-17 11:14:08 -05:00
mx-puppet-discord.nix Merge pull request #147441 from pennae/option-doc-staticizing 2021-12-06 01:35:38 +01:00
n8n.nix n8n: 0.105.0 -> 0.160.0, fix build 2022-01-22 23:43:56 +03:00
nitter.nix nixos/nitter: remove syslog.target from service (#150224) 2021-12-11 14:45:54 -05:00
nix-daemon.nix nixos/nix-daemon: use structural settings 2022-01-26 21:04:50 -05:00
nix-gc.nix nixos/nix-gc: add persistent and randomizeDelaySec options 2021-02-28 04:21:21 -05:00
nix-optimise.nix
nix-ssh-serve.nix nixos/nix-daemon: use structural settings 2022-01-26 21:04:50 -05:00
novacomd.nix
nzbget.nix nixos/nzbget: add settings option 2021-08-17 09:19:22 -04:00
nzbhydra2.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
octoprint.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
ombi.nix nixos/ombi: set ombi as system user 2021-04-29 10:52:02 +03:00
osrm.nix
owncast.nix nixos/owncast: init owncast service 2021-09-23 10:48:29 +02:00
packagekit.nix nixos/packagekit: RFC42 support and drop pointless setting 2021-04-06 11:41:37 +08:00
paperless-ng.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
parsoid.nix
pinnwand.nix nixos/pinnwand: add reaper systemd unit/timer 2021-05-03 16:52:05 +02:00
plex.nix nixos/plex: replace literalExample with literalExpression 2021-11-16 20:37:44 +02:00
plikd.nix nixos/plikd: Add new service module 2021-02-23 15:35:16 +01:00
podgrab.nix nixos/podgrab: add module 2021-04-15 20:57:21 +00:00
prowlarr.nix nixos/prowlarr: init 2021-10-10 14:05:33 -07:00
pykms.nix nixos/pykms: fix launcher 2021-02-03 15:59:17 +08:00
radarr.nix
redmine.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
ripple-data-api.nix nixos/ripple-data-api: define group 2021-09-18 12:00:00 +00:00
rippled.nix treewide: add literalDocBook text to options with complex defaults 2021-12-09 01:38:24 +01:00
safeeyes.nix nixos/safeeyes: add safeeyes to the global path 2021-09-22 13:12:27 +02:00
sdrplay.nix sdrplay: init at 3.07.1 2021-05-28 15:40:04 +02:00
serviio.nix
sickbeard.nix treewide: add defaultText for options with simple interpolation defaults 2021-12-09 01:13:48 +01:00
signald.nix signald: add module 2021-10-29 22:48:10 +02:00
siproxd.nix nixos/*: fix indentation 2020-11-23 08:42:51 +10:00
snapper.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
sonarr.nix
spice-vdagentd.nix
ssm-agent.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
sssd.nix nixos/sssd: fix the module 2020-08-24 10:10:47 -04:00
subsonic.nix treewide: make option descriptions constants 2021-12-09 01:21:04 +01:00
sundtek.nix
svnserve.nix nixos/svnserve: add svnBaseDir type 2021-01-31 12:15:45 +01:00
synergy.nix nixos/synergy: add encryption support 2021-06-11 14:52:34 +02:00
sysprof.nix
tautulli.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
tiddlywiki.nix
tp-auto-kbbl.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
tzupdate.nix
uhub.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
weechat.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
weechat.xml
xmr-stak.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
xmrig.nix nixos/*: add trivial defaultText for options with simple defaults 2021-12-02 22:35:04 +01:00
zigbee2mqtt.nix nixos/zigbee2mqtt: run as zigbee2mqtt group 2021-12-06 18:30:01 +01:00
zoneminder.nix treewide: make option descriptions constants 2021-12-09 01:21:04 +01:00
zookeeper.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00