Merge pull request #276525 from scvalex/livebook-configurable-package
livebook: configurable package and extraPackages
This commit is contained in:
commit
56b8564a7d
@ -18,7 +18,7 @@ which runs the server.
|
||||
port = 20123;
|
||||
# See note below about security
|
||||
environmentFile = pkgs.writeText "livebook.env" ''
|
||||
LIVEBOOK_PASSWORD = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
LIVEBOOK_PASSWORD = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
'';
|
||||
};
|
||||
}
|
||||
@ -37,3 +37,14 @@ A better approach would be to put the password in some secure
|
||||
user-readable location and set `environmentFile = /home/user/secure/livebook.env`.
|
||||
|
||||
:::
|
||||
|
||||
### Extra dependencies {#module-services-livebook-extra-dependencies}
|
||||
|
||||
By default, the Livebook service is run with minimum dependencies, but
|
||||
some features require additional packages. For example, the machine
|
||||
learning Kinos require `gcc` and `gnumake`. To add these, use
|
||||
`extraPackages`:
|
||||
|
||||
```
|
||||
services.livebook.extraPackages = with pkgs; [ gcc gnumake ];
|
||||
```
|
||||
|
@ -12,6 +12,8 @@ in
|
||||
# future, this can be changed to a system service.
|
||||
enableUserService = mkEnableOption "a user service for Livebook";
|
||||
|
||||
package = mkPackageOption pkgs "livebook" { };
|
||||
|
||||
environmentFile = mkOption {
|
||||
type = types.path;
|
||||
description = lib.mdDoc ''
|
||||
@ -63,6 +65,15 @@ in
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
type = with types; listOf package;
|
||||
default = [ ];
|
||||
description = lib.mdDoc ''
|
||||
Extra packages to make available to the Livebook service.
|
||||
'';
|
||||
example = literalExpression "with pkgs; [ gcc gnumake ]";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enableUserService {
|
||||
@ -79,9 +90,9 @@ in
|
||||
sname = cfg.erlang_node_short_name;
|
||||
} // cfg.options);
|
||||
in
|
||||
"${pkgs.livebook}/bin/livebook server ${args}";
|
||||
"${cfg.package}/bin/livebook server ${args}";
|
||||
};
|
||||
path = [ pkgs.bash ];
|
||||
path = [ pkgs.bash ] ++ cfg.extraPackages;
|
||||
wantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||
enableUserService = true;
|
||||
port = 20123;
|
||||
environmentFile = pkgs.writeText "livebook.env" ''
|
||||
LIVEBOOK_PASSWORD = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
LIVEBOOK_PASSWORD = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
'';
|
||||
options = {
|
||||
cookie = "chocolate chip";
|
||||
|
Loading…
Reference in New Issue
Block a user