mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
nixos/docker: add daemonConfig option
Adds the virtualisation.docker.daemonConfig option that allows changing Docker daemon settings as done in daemon.conf.
This commit is contained in:
parent
9308070388
commit
142a1540d6
3 changed files with 27 additions and 1 deletions
|
@ -8,7 +8,8 @@ let
|
|||
|
||||
cfg = config.virtualisation.docker;
|
||||
proxy_env = config.networking.proxy.envVars;
|
||||
|
||||
daemonConfigJson = builtins.toJSON cfg.daemonConfig;
|
||||
daemonConfigFile = pkgs.writeText "daemon.json" daemonConfigJson;
|
||||
in
|
||||
|
||||
{
|
||||
|
@ -52,6 +53,20 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
daemonConfig =
|
||||
mkOption {
|
||||
type = types.anything;
|
||||
default = { };
|
||||
example = {
|
||||
ipv6 = true;
|
||||
"fixed-cidr-v6" = "fd00::/80";
|
||||
};
|
||||
description = ''
|
||||
Configuration for docker daemon. The attributes are serialized to JSON used as daemon.conf.
|
||||
See https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file
|
||||
'';
|
||||
};
|
||||
|
||||
enableNvidia =
|
||||
mkOption {
|
||||
type = types.bool;
|
||||
|
@ -173,6 +188,7 @@ in
|
|||
${cfg.package}/bin/dockerd \
|
||||
--group=docker \
|
||||
--host=fd:// \
|
||||
--config-file=${daemonConfigFile} \
|
||||
--log-driver=${cfg.logDriver} \
|
||||
${optionalString (cfg.storageDriver != null) "--storage-driver=${cfg.storageDriver}"} \
|
||||
${optionalString cfg.liveRestore "--live-restore" } \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue