From ac49df440fcc2b54dba4cf1a2fa03c0baf60adbd Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 11 Mar 2019 14:36:49 +0100 Subject: [PATCH] Add service.devices option --- src/nix/modules/service/docker-compose-service.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/nix/modules/service/docker-compose-service.nix b/src/nix/modules/service/docker-compose-service.nix index 9f336f9..43a4c60 100644 --- a/src/nix/modules/service/docker-compose-service.nix +++ b/src/nix/modules/service/docker-compose-service.nix @@ -95,6 +95,16 @@ in default = []; description = dockerComposeRef "depends_on"; }; + service.devices = mkOption { + type = listOf str; + default = []; + description = '' + See ${link "https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities" + "docker run --device documentation"} + + ${dockerComposeRef "devices"} + ''; + }; service.links = mkOption { type = listOf str; default = []; @@ -195,6 +205,8 @@ in inherit (config.service) command; } // lib.optionalAttrs (config.service.depends_on != []) { inherit (config.service) depends_on; + } // lib.optionalAttrs (config.service.devices != []) { + inherit (config.service) devices; } // lib.optionalAttrs (config.service.entrypoint != null) { inherit (config.service) entrypoint; } // lib.optionalAttrs (config.service.env_file != []) {