move cli options to json daemon settings

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

View file

@ -186,13 +186,7 @@ in
""
''
${cfg.package}/bin/dockerd \
--group=docker \
--host=fd:// \
--config-file=${daemonSettingsFile} \
--log-driver=${cfg.logDriver} \
${optionalString (cfg.storageDriver != null) "--storage-driver=${cfg.storageDriver}"} \
${optionalString cfg.liveRestore "--live-restore" } \
${optionalString cfg.enableNvidia "--add-runtime nvidia=${pkgs.nvidia-docker}/bin/nvidia-container-runtime" } \
${cfg.extraOptions}
''];
ExecReload=[
@ -235,6 +229,19 @@ in
{ assertion = cfg.enableNvidia -> config.hardware.opengl.driSupport32Bit or false;
message = "Option enableNvidia requires 32bit support libraries";
}];
virtualisation.docker.daemon.settings = {
group = "docker";
hosts = [ "fd://" ];
"log-driver" = cfg.logDriver;
"storage-driver" = mkIf (cfg.storageDriver != null) cfg.storageDriver;
"live-restore" = cfg.liveRestore;
runtimes = mkIf cfg.enableNvidia {
nvidia = {
path = "${pkgs.nvidia-docker}/bin/nvidia-container-runtime";
};
};
};
}
]);