Merge pull request #11 from srghma/master

feat: docker-config -> add missing fields
This commit is contained in:
Robert Hensing 2019-01-13 21:31:00 +01:00 committed by GitHub
commit 93346145cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,8 +2,7 @@
let let
inherit (lib) mkOption types; inherit (lib) mkOption types;
inherit (types) listOf nullOr attrsOf string either; inherit (types) listOf nullOr attrsOf string either int;
in in
{ {
options = { options = {
@ -16,7 +15,7 @@ in
default = null; default = null;
}; };
service.environment = mkOption { service.environment = mkOption {
type = attrsOf string; type = attrsOf (either string int);
default = {}; default = {};
}; };
service.image = mkOption { service.image = mkOption {
@ -30,6 +29,14 @@ in
type = listOf string; type = listOf string;
default = []; default = [];
}; };
service.working_dir = mkOption {
type = nullOr string;
default = null;
};
service.entrypoint = mkOption {
type = nullOr string;
default = null;
};
service.restart = mkOption { service.restart = mkOption {
type = nullOr string; type = nullOr string;
default = null; default = null;
@ -66,6 +73,10 @@ in
inherit (config.service) depends_on; inherit (config.service) depends_on;
} // lib.optionalAttrs (config.service.restart != null) { } // lib.optionalAttrs (config.service.restart != null) {
inherit (config.service) restart; 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 != []) { } // lib.optionalAttrs (config.service.ports != []) {
inherit (config.service) ports; inherit (config.service) ports;
} // lib.optionalAttrs (config.service.expose != []) { } // lib.optionalAttrs (config.service.expose != []) {