···
package = mkPackageOption pkgs "livebook" { };
+
environment = mkOption {
+
type = with types; attrsOf (nullOr (oneOf [ bool int str ]));
description = lib.mdDoc ''
+
Environment variables to set.
+
Livebook is configured through the use of environment variables. The
+
available configuration options can be found in the [Livebook
+
documentation](https://hexdocs.pm/livebook/readme.html#environment-variables).
+
Note that all environment variables set through this configuration
+
parameter will be readable by anyone with access to the host
+
machine. Therefore, sensitive information like {env}`LIVEBOOK_PASSWORD`
+
or {env}`LIVEBOOK_COOKIE` should never be set using this configuration
+
option, but should instead use
+
[](#opt-services.livebook.environmentFile). See the documentation for
+
that option for more information.
+
Any environment variables specified in the
+
[](#opt-services.livebook.environmentFile) will supersede environment
+
variables specified in this option.
example = literalExpression ''
+
environmentFile = mkOption {
+
type = with types; nullOr types.path;
+
description = lib.mdDoc ''
+
Additional dnvironment file as defined in {manpage}`systemd.exec(5)`.
+
Secrets like {env}`LIVEBOOK_PASSWORD` (which is used to specify the
+
password needed to access the livebook site) or {env}`LIVEBOOK_COOKIE`
+
(which is used to specify the
+
[cookie](https://www.erlang.org/doc/reference_manual/distributed.html#security)
+
used to connect to the running Elixir system) may be passed to the
+
service without making them readable to everyone with access to
+
systemctl by using this configuration parameter.
+
Note that this file needs to be available on the host on which
+
For security purposes, this file should contain at least
+
{env}`LIVEBOOK_PASSWORD` or {env}`LIVEBOOK_TOKEN_ENABLED=false`.
+
documentation](https://hexdocs.pm/livebook/readme.html#environment-variables)
+
and the [](#opt-services.livebook.environment) configuration parameter
+
example = "/var/lib/livebook.env";
extraPackages = mkOption {
type = with types; listOf package;
···
EnvironmentFile = cfg.environmentFile;
+
ExecStart = "${cfg.package}/bin/livebook start";
+
environment = mapAttrs (name: value:
+
if isBool value then boolToString value else toString value)
path = [ pkgs.bash ] ++ cfg.extraPackages;
wantedBy = [ "default.target" ];