From 380ae56e4f44ca4fd27ea78252512ade043ea432 Mon Sep 17 00:00:00 2001 From: Sergei Khoma Date: Sun, 13 Jan 2019 16:24:56 +0200 Subject: [PATCH] feat: docker-config -> add missing fields --- src/nix/service.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/nix/service.nix b/src/nix/service.nix index 2e06e48..b745018 100644 --- a/src/nix/service.nix +++ b/src/nix/service.nix @@ -2,8 +2,7 @@ let inherit (lib) mkOption types; - inherit (types) listOf nullOr attrsOf string either; - + inherit (types) listOf nullOr attrsOf string either int; in { options = { @@ -16,7 +15,7 @@ in default = null; }; service.environment = mkOption { - type = attrsOf string; + type = attrsOf (either string int); default = {}; }; service.image = mkOption { @@ -30,6 +29,14 @@ in type = listOf string; default = []; }; + service.working_dir = mkOption { + type = nullOr string; + default = null; + }; + service.entrypoint = mkOption { + type = nullOr string; + default = null; + }; service.restart = mkOption { type = nullOr string; default = null; @@ -66,6 +73,10 @@ in inherit (config.service) depends_on; } // lib.optionalAttrs (config.service.restart != null) { inherit (config.service) restart; + } // lib.optionalAttrs (config.service.working_dir != null) { + inherit (config.service) working_dir; + } // lib.optionalAttrs (config.service.entrypoint != null) { + inherit (config.service) entrypoint; } // lib.optionalAttrs (config.service.ports != []) { inherit (config.service) ports; } // lib.optionalAttrs (config.service.expose != []) {