use pkgs.formats.json

This commit is contained in:
Bob van der Linden 2021-10-13 22:29:29 +02:00
parent c1b0d4acf5
commit e8dae9246b
No known key found for this signature in database
GPG key ID: EEBE8E3EC4A31364

View file

@ -8,8 +8,8 @@ let
cfg = config.virtualisation.docker;
proxy_env = config.networking.proxy.envVars;
daemonSettingsJson = builtins.toJSON cfg.daemon.settings;
daemonSettingsFile = pkgs.writeText "daemon.json" daemonSettingsJson;
settingsFormat = pkgs.formats.json {};
daemonSettingsFile = settingsFormat.generate "daemon.json" cfg.daemon.settings;
in
{
@ -55,7 +55,7 @@ in
daemon.settings =
mkOption {
type = types.anything;
type = settingsFormat.type;
default = { };
example = {
ipv6 = true;