2019-01-20 12:22:28 +01:00
|
|
|
/*
|
|
|
|
|
2019-10-03 21:30:14 +02:00
|
|
|
This service-level module defines the out.service option, using
|
2019-01-20 12:22:28 +01:00
|
|
|
the user-facing options service.image, service.volumes, etc.
|
|
|
|
|
|
|
|
*/
|
2022-04-27 19:43:16 -06:00
|
|
|
{ pkgs, lib, config, options, ... }:
|
2018-12-17 19:08:38 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) mkOption types;
|
2022-04-27 14:23:25 -06:00
|
|
|
inherit (types) listOf nullOr attrsOf str either int bool submodule enum;
|
2019-03-03 23:42:40 +01:00
|
|
|
|
2022-06-09 01:20:09 +02:00
|
|
|
inherit (import ../../lib.nix { inherit lib; })
|
|
|
|
link
|
2023-07-19 15:50:08 +02:00
|
|
|
serviceRef
|
2022-06-09 01:20:09 +02:00
|
|
|
;
|
|
|
|
|
2019-03-11 14:36:18 +01:00
|
|
|
cap_add = lib.attrNames (lib.filterAttrs (name: value: value == true) config.service.capabilities);
|
|
|
|
cap_drop = lib.attrNames (lib.filterAttrs (name: value: value == false) config.service.capabilities);
|
|
|
|
|
2018-12-17 19:08:38 +01:00
|
|
|
in
|
|
|
|
{
|
2019-10-03 21:30:14 +02:00
|
|
|
imports = [
|
|
|
|
(lib.mkRenamedOptionModule ["build" "service"] ["out" "service"])
|
|
|
|
];
|
|
|
|
|
2018-12-17 19:08:38 +01:00
|
|
|
options = {
|
2019-10-03 21:30:14 +02:00
|
|
|
out.service = mkOption {
|
2019-03-04 00:13:57 +01:00
|
|
|
type = attrsOf types.unspecified;
|
|
|
|
description = ''
|
2019-10-29 12:52:00 +01:00
|
|
|
Raw input for the service in `docker-compose.yaml`.
|
2019-03-04 00:13:57 +01:00
|
|
|
|
|
|
|
You should not need to use this option. If anything is
|
|
|
|
missing, please contribute the missing option.
|
|
|
|
|
|
|
|
This option is user accessible because it may serve as an
|
|
|
|
escape hatch for some.
|
|
|
|
'';
|
2019-10-03 21:30:14 +02:00
|
|
|
apply = config.assertWarn;
|
2019-03-04 00:13:57 +01:00
|
|
|
};
|
|
|
|
|
2019-03-11 14:44:18 +01:00
|
|
|
service.name = mkOption {
|
|
|
|
type = str;
|
|
|
|
description = ''
|
2019-10-29 12:52:00 +01:00
|
|
|
The name of the service - `<name>` in the composition-level `services.<name>`
|
2019-03-11 14:44:18 +01:00
|
|
|
'';
|
|
|
|
readOnly = true;
|
|
|
|
};
|
|
|
|
|
2018-12-17 19:08:38 +01:00
|
|
|
service.volumes = mkOption {
|
|
|
|
type = listOf types.unspecified;
|
|
|
|
default = [];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "volumes";
|
2019-03-05 19:41:54 +01:00
|
|
|
};
|
|
|
|
service.tmpfs = mkOption {
|
|
|
|
type = listOf types.str;
|
|
|
|
default = [];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "tmpfs";
|
2018-12-17 19:08:38 +01:00
|
|
|
};
|
|
|
|
service.build.context = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = nullOr str;
|
2018-12-17 19:08:38 +01:00
|
|
|
default = null;
|
2019-03-03 23:42:40 +01:00
|
|
|
description = ''
|
|
|
|
Locates a Dockerfile to use for creating an image to use in this service.
|
|
|
|
|
2023-07-19 15:50:08 +02:00
|
|
|
https://docs.docker.com/compose/compose-file/build/#context
|
2019-03-03 23:42:40 +01:00
|
|
|
'';
|
2018-12-17 19:08:38 +01:00
|
|
|
};
|
2019-02-03 21:07:00 +02:00
|
|
|
service.hostname = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = nullOr str;
|
2019-02-03 21:07:00 +02:00
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = ''
|
|
|
|
${serviceRef "hostname"}
|
|
|
|
'';
|
2019-02-03 21:07:00 +02:00
|
|
|
};
|
2019-03-05 19:41:54 +01:00
|
|
|
service.tty = mkOption {
|
|
|
|
type = nullOr bool;
|
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = ''
|
|
|
|
${serviceRef "tty"}
|
|
|
|
'';
|
2019-03-05 19:41:54 +01:00
|
|
|
};
|
2018-12-17 19:08:38 +01:00
|
|
|
service.environment = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = attrsOf (either str int);
|
2018-12-17 19:08:38 +01:00
|
|
|
default = {};
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "environment";
|
2018-12-17 19:08:38 +01:00
|
|
|
};
|
|
|
|
service.image = mkOption {
|
2023-08-19 22:13:18 +02:00
|
|
|
type = nullOr str;
|
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "image";
|
2018-12-17 19:08:38 +01:00
|
|
|
};
|
|
|
|
service.command = mkOption {
|
|
|
|
type = nullOr types.unspecified;
|
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "command";
|
2018-12-17 19:08:38 +01:00
|
|
|
};
|
2019-09-16 20:35:39 +03:00
|
|
|
service.container_name = mkOption {
|
|
|
|
type = nullOr types.str;
|
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "container_name";
|
2019-09-16 20:35:39 +03:00
|
|
|
};
|
2022-04-27 14:23:25 -06:00
|
|
|
service.depends_on =
|
|
|
|
let conditionsModule = {
|
|
|
|
options = {
|
|
|
|
condition = mkOption {
|
|
|
|
type = enum ["service_started" "service_healthy" "service_completed_successfully"];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "depends_on";
|
2022-04-27 14:23:25 -06:00
|
|
|
default = "service_started";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in mkOption {
|
|
|
|
type = either (listOf str) (attrsOf (submodule conditionsModule));
|
|
|
|
default = [];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "depends_on";
|
2022-04-27 19:43:16 -06:00
|
|
|
};
|
|
|
|
service.healthcheck = mkOption {
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "healthcheck";
|
2022-04-27 19:43:16 -06:00
|
|
|
type = submodule ({ config, options, ...}: {
|
|
|
|
options = {
|
|
|
|
_out = mkOption {
|
|
|
|
internal = true;
|
|
|
|
default = lib.optionalAttrs (options.test.highestPrio < 1500) {
|
|
|
|
inherit (config) test interval timeout start_period retries;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
test = mkOption {
|
|
|
|
type = nullOr (listOf str);
|
|
|
|
default = null;
|
|
|
|
example = [ "CMD" "pg_isready" ];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "healthcheck";
|
2022-04-27 19:43:16 -06:00
|
|
|
};
|
|
|
|
interval = mkOption {
|
|
|
|
type = str;
|
|
|
|
default = "30s";
|
|
|
|
example = "1m";
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "healthcheck";
|
2022-04-27 19:43:16 -06:00
|
|
|
};
|
|
|
|
timeout = mkOption {
|
|
|
|
type = str;
|
|
|
|
default = "30s";
|
|
|
|
example = "10s";
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "healthcheck";
|
2022-04-27 19:43:16 -06:00
|
|
|
};
|
|
|
|
start_period = mkOption {
|
|
|
|
type = str;
|
|
|
|
default = "0s";
|
|
|
|
example = "30s";
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "healthcheck";
|
2022-04-27 19:43:16 -06:00
|
|
|
};
|
|
|
|
retries = mkOption {
|
|
|
|
type = int;
|
|
|
|
default = 3;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "healthcheck";
|
2022-04-27 19:43:16 -06:00
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
2022-04-26 18:19:56 -06:00
|
|
|
};
|
2019-03-11 14:36:49 +01:00
|
|
|
service.devices = mkOption {
|
|
|
|
type = listOf str;
|
|
|
|
default = [];
|
|
|
|
description = ''
|
|
|
|
See ${link "https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities"
|
2019-10-29 12:52:00 +01:00
|
|
|
"`docker run --device` documentation"}
|
2019-03-11 14:36:49 +01:00
|
|
|
|
2023-07-19 15:50:08 +02:00
|
|
|
${serviceRef "devices"}
|
2019-03-11 14:36:49 +01:00
|
|
|
'';
|
|
|
|
};
|
2021-04-10 00:51:40 +01:00
|
|
|
service.dns = mkOption {
|
|
|
|
type = listOf str;
|
|
|
|
default = [];
|
|
|
|
example = [ "8.8.8.8" "8.8.4.4" ];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "dns";
|
2021-04-10 00:51:40 +01:00
|
|
|
};
|
2021-01-20 18:11:52 +01:00
|
|
|
service.labels = mkOption {
|
|
|
|
type = attrsOf str;
|
|
|
|
default = {};
|
2021-01-22 10:35:57 +01:00
|
|
|
example = {
|
|
|
|
"com.example.foo" = "bar";
|
|
|
|
"traefik.enable" = "true";
|
|
|
|
"traefik.http.routers.my-service.rule" = "Host(`my-service.localhost`)";
|
|
|
|
"traefik.http.routers.my-service.entrypoints" = "web";
|
|
|
|
};
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "labels";
|
2021-01-20 18:11:52 +01:00
|
|
|
};
|
2019-02-03 22:24:26 +02:00
|
|
|
service.links = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = listOf str;
|
2019-02-03 22:24:26 +02:00
|
|
|
default = [];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "links";
|
2019-02-03 22:24:26 +02:00
|
|
|
};
|
|
|
|
service.external_links = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = listOf str;
|
2019-02-03 22:24:26 +02:00
|
|
|
default = [];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "external_links";
|
2019-02-03 22:24:26 +02:00
|
|
|
};
|
|
|
|
service.extra_hosts = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = listOf str;
|
2019-02-03 22:24:26 +02:00
|
|
|
default = [];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "extra_hosts";
|
2019-02-03 22:24:26 +02:00
|
|
|
};
|
2019-01-13 16:24:56 +02:00
|
|
|
service.working_dir = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = nullOr str;
|
2019-01-13 16:24:56 +02:00
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = ''
|
|
|
|
${serviceRef "working_dir"}
|
|
|
|
'';
|
2019-01-13 16:24:56 +02:00
|
|
|
};
|
2019-02-03 21:07:00 +02:00
|
|
|
service.privileged = mkOption {
|
|
|
|
type = nullOr bool;
|
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = ''
|
|
|
|
${serviceRef "privileged"}
|
|
|
|
'';
|
2019-02-03 21:07:00 +02:00
|
|
|
};
|
2019-01-13 16:24:56 +02:00
|
|
|
service.entrypoint = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = nullOr str;
|
2019-01-13 16:24:56 +02:00
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "entrypoint";
|
2019-01-13 16:24:56 +02:00
|
|
|
};
|
2018-12-17 19:08:38 +01:00
|
|
|
service.restart = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = nullOr str;
|
2018-12-17 19:08:38 +01:00
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "restart";
|
2018-12-17 19:08:38 +01:00
|
|
|
};
|
2019-05-07 14:14:49 +07:00
|
|
|
service.user = mkOption {
|
|
|
|
type = nullOr str;
|
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = ''
|
|
|
|
${serviceRef "user"}
|
|
|
|
'';
|
2019-05-07 14:14:49 +07:00
|
|
|
};
|
2018-12-17 19:08:38 +01:00
|
|
|
service.ports = mkOption {
|
|
|
|
type = listOf types.unspecified;
|
|
|
|
default = [];
|
|
|
|
description = ''
|
|
|
|
Expose ports on host. "host:container" or structured.
|
2019-03-03 23:42:40 +01:00
|
|
|
|
2023-07-19 15:50:08 +02:00
|
|
|
${serviceRef "ports"}
|
2018-12-17 19:08:38 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
service.expose = mkOption {
|
2019-03-04 00:12:01 +01:00
|
|
|
type = listOf str;
|
2018-12-17 19:08:38 +01:00
|
|
|
default = [];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "expose";
|
2018-12-17 19:08:38 +01:00
|
|
|
};
|
2019-03-04 00:28:42 +01:00
|
|
|
service.env_file = mkOption {
|
|
|
|
type = listOf str;
|
|
|
|
default = [];
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "env_file";
|
2019-03-04 00:28:42 +01:00
|
|
|
};
|
|
|
|
service.network_mode = mkOption {
|
|
|
|
type = nullOr str;
|
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "network_mode";
|
2019-03-04 00:28:42 +01:00
|
|
|
};
|
2023-07-19 18:12:42 +09:00
|
|
|
service.networks =
|
|
|
|
let
|
|
|
|
networksModule = submodule ({ config, options, ...}: {
|
|
|
|
options = {
|
|
|
|
_out = mkOption {
|
|
|
|
internal = true;
|
|
|
|
readOnly = true;
|
2023-07-20 00:17:02 +09:00
|
|
|
default = lib.mapAttrs (k: opt: opt.value) (lib.filterAttrs (_: opt: opt.isDefined) { inherit (options) aliases ipv4_address ipv6_address link_local_ips priority; });
|
2023-07-19 18:12:42 +09:00
|
|
|
};
|
|
|
|
aliases = mkOption {
|
|
|
|
type = listOf str;
|
|
|
|
description = serviceRef "aliases";
|
|
|
|
default = [ ];
|
|
|
|
};
|
|
|
|
ipv4_address = mkOption {
|
|
|
|
type = str;
|
|
|
|
description = serviceRef "ipv4_address-ipv6_address";
|
|
|
|
};
|
|
|
|
ipv6_address = mkOption {
|
|
|
|
type = str;
|
|
|
|
description = serviceRef "ipv4_address-ipv6_address";
|
|
|
|
};
|
2023-07-20 00:17:02 +09:00
|
|
|
link_local_ips = mkOption {
|
|
|
|
type = listOf str;
|
|
|
|
description = serviceRef "link_local_ips";
|
|
|
|
};
|
|
|
|
priority = mkOption {
|
|
|
|
type = int;
|
|
|
|
description = serviceRef "priority";
|
|
|
|
};
|
2023-07-19 18:12:42 +09:00
|
|
|
};
|
|
|
|
});
|
|
|
|
in
|
|
|
|
mkOption {
|
|
|
|
type = either (listOf str) (attrsOf networksModule);
|
|
|
|
default = [];
|
|
|
|
description = serviceRef "networks";
|
|
|
|
};
|
2019-03-05 19:41:54 +01:00
|
|
|
service.stop_signal = mkOption {
|
|
|
|
type = nullOr str;
|
|
|
|
default = null;
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "stop_signal";
|
2019-03-05 19:41:54 +01:00
|
|
|
};
|
2023-11-06 21:58:30 -08:00
|
|
|
service.stop_grace_period = mkOption {
|
|
|
|
type = nullOr str;
|
|
|
|
default = null;
|
|
|
|
description = serviceRef "stop_grace_period";
|
|
|
|
};
|
2019-05-07 15:33:24 +07:00
|
|
|
service.sysctls = mkOption {
|
|
|
|
type = attrsOf (either str int);
|
|
|
|
default = {};
|
2023-07-19 15:50:08 +02:00
|
|
|
description = serviceRef "sysctls";
|
2019-05-07 15:33:24 +07:00
|
|
|
};
|
2019-03-11 14:36:18 +01:00
|
|
|
service.capabilities = mkOption {
|
|
|
|
type = attrsOf (nullOr bool);
|
|
|
|
default = {};
|
|
|
|
example = { ALL = true; SYS_ADMIN = false; NET_ADMIN = false; };
|
|
|
|
description = ''
|
|
|
|
Enable/disable linux capabilities, or pick Docker's default.
|
|
|
|
|
2019-10-29 12:52:00 +01:00
|
|
|
Setting a capability to `true` means that it will be
|
|
|
|
"added". Setting it to `false` means that it will be "dropped".
|
2019-03-11 14:36:18 +01:00
|
|
|
|
2019-10-29 12:52:00 +01:00
|
|
|
Omitted and `null` capabilities will therefore be set
|
2019-03-11 14:36:18 +01:00
|
|
|
according to Docker's ${
|
|
|
|
link "https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities"
|
|
|
|
"default list of capabilities."
|
|
|
|
}
|
2023-07-19 15:50:08 +02:00
|
|
|
|
|
|
|
${serviceRef "cap_add"}
|
|
|
|
${serviceRef "cap_drop"}
|
2019-03-11 14:36:18 +01:00
|
|
|
'';
|
|
|
|
};
|
2018-12-17 19:08:38 +01:00
|
|
|
};
|
|
|
|
|
2019-10-03 21:30:14 +02:00
|
|
|
config.out.service = {
|
2018-12-17 19:08:38 +01:00
|
|
|
inherit (config.service)
|
|
|
|
volumes
|
|
|
|
environment
|
2019-05-07 15:33:24 +07:00
|
|
|
sysctls
|
2018-12-17 19:08:38 +01:00
|
|
|
;
|
2023-08-19 22:13:18 +02:00
|
|
|
} // lib.optionalAttrs (config.service.image != null) {
|
|
|
|
inherit (config.service) image;
|
2018-12-17 19:08:38 +01:00
|
|
|
} // lib.optionalAttrs (config.service.build.context != null) {
|
|
|
|
inherit (config.service) build;
|
2019-03-11 14:36:18 +01:00
|
|
|
} // lib.optionalAttrs (cap_add != []) {
|
|
|
|
inherit cap_add;
|
|
|
|
} // lib.optionalAttrs (cap_drop != []) {
|
|
|
|
inherit cap_drop;
|
2018-12-17 19:08:38 +01:00
|
|
|
} // lib.optionalAttrs (config.service.command != null) {
|
|
|
|
inherit (config.service) command;
|
2019-09-16 20:35:39 +03:00
|
|
|
} // lib.optionalAttrs (config.service.container_name != null) {
|
|
|
|
inherit (config.service) container_name;
|
2018-12-17 19:08:38 +01:00
|
|
|
} // lib.optionalAttrs (config.service.depends_on != []) {
|
|
|
|
inherit (config.service) depends_on;
|
2022-04-27 19:43:16 -06:00
|
|
|
} // lib.optionalAttrs (options.service.healthcheck.highestPrio < 1500) {
|
|
|
|
healthcheck = config.service.healthcheck._out;
|
2019-03-11 14:36:49 +01:00
|
|
|
} // lib.optionalAttrs (config.service.devices != []) {
|
|
|
|
inherit (config.service) devices;
|
2019-01-13 16:24:56 +02:00
|
|
|
} // lib.optionalAttrs (config.service.entrypoint != null) {
|
|
|
|
inherit (config.service) entrypoint;
|
2019-03-04 00:28:42 +01:00
|
|
|
} // lib.optionalAttrs (config.service.env_file != []) {
|
|
|
|
inherit (config.service) env_file;
|
2018-12-17 19:08:38 +01:00
|
|
|
} // lib.optionalAttrs (config.service.expose != []) {
|
|
|
|
inherit (config.service) expose;
|
2019-03-04 00:28:42 +01:00
|
|
|
} // lib.optionalAttrs (config.service.external_links != []) {
|
|
|
|
inherit (config.service) external_links;
|
|
|
|
} // lib.optionalAttrs (config.service.extra_hosts != []) {
|
|
|
|
inherit (config.service) extra_hosts;
|
|
|
|
} // lib.optionalAttrs (config.service.hostname != null) {
|
|
|
|
inherit (config.service) hostname;
|
2021-04-10 00:51:40 +01:00
|
|
|
} // lib.optionalAttrs (config.service.dns != []) {
|
|
|
|
inherit (config.service) dns;
|
2021-01-20 18:11:52 +01:00
|
|
|
} // lib.optionalAttrs (config.service.labels != {}) {
|
|
|
|
inherit (config.service) labels;
|
2019-03-04 00:28:42 +01:00
|
|
|
} // lib.optionalAttrs (config.service.links != []) {
|
|
|
|
inherit (config.service) links;
|
|
|
|
} // lib.optionalAttrs (config.service.ports != []) {
|
|
|
|
inherit (config.service) ports;
|
|
|
|
} // lib.optionalAttrs (config.service.privileged != null) {
|
|
|
|
inherit (config.service) privileged;
|
|
|
|
} // lib.optionalAttrs (config.service.network_mode != null) {
|
|
|
|
inherit (config.service) network_mode;
|
2023-07-19 18:12:42 +09:00
|
|
|
} // lib.optionalAttrs (config.service.networks != [] && config.service.networks != {}) {
|
|
|
|
networks =
|
|
|
|
if (builtins.isAttrs config.service.networks) then builtins.mapAttrs (_: v: v._out) config.service.networks
|
|
|
|
else config.service.networks;
|
2019-03-04 00:28:42 +01:00
|
|
|
} // lib.optionalAttrs (config.service.restart != null) {
|
|
|
|
inherit (config.service) restart;
|
2019-03-05 19:41:54 +01:00
|
|
|
} // lib.optionalAttrs (config.service.stop_signal != null) {
|
|
|
|
inherit (config.service) stop_signal;
|
2023-11-06 21:58:30 -08:00
|
|
|
} // lib.optionalAttrs (config.service.stop_grace_period != null) {
|
|
|
|
inherit (config.service) stop_grace_period;
|
2019-03-05 19:41:54 +01:00
|
|
|
} // lib.optionalAttrs (config.service.tmpfs != []) {
|
|
|
|
inherit (config.service) tmpfs;
|
|
|
|
} // lib.optionalAttrs (config.service.tty != null) {
|
|
|
|
inherit (config.service) tty;
|
2019-03-04 00:28:42 +01:00
|
|
|
} // lib.optionalAttrs (config.service.working_dir != null) {
|
|
|
|
inherit (config.service) working_dir;
|
2019-05-07 14:14:49 +07:00
|
|
|
} // lib.optionalAttrs (config.service.user != null) {
|
|
|
|
inherit (config.service) user;
|
2018-12-17 19:08:38 +01:00
|
|
|
};
|
|
|
|
}
|