about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/services/development/livebook.md
blob: 73ddc57f6179a89d5ad280205ddf401f235d346d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Livebook {#module-services-livebook}

[Livebook](https://livebook.dev/) is a web application for writing
interactive and collaborative code notebooks.

## Basic Usage {#module-services-livebook-basic-usage}

Enabling the `livebook` service creates a user
[`systemd`](https://www.freedesktop.org/wiki/Software/systemd/) unit
which runs the server.

```
{ ... }:

{
  services.livebook = {
    enableUserService = true;
    port = 20123;
    # See note below about security
    environmentFile = pkgs.writeText "livebook.env" ''
      LIVEBOOK_PASSWORD = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    '';
  };
}
```

::: {.note}

The Livebook server has the ability to run any command as the user it
is running under, so securing access to it with a password is highly
recommended.

Putting the password in the Nix configuration like above is an easy
way to get started but it is not recommended in the real world because
the `livebook.env` file will be added to the world-readable Nix store.
A better approach would be to put the password in some secure
user-readable location and set `environmentFile = /home/user/secure/livebook.env`.

:::