Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit e90d4cf

Browse files
docs: add section on Nix flake
1 parent 1de02b8 commit e90d4cf

2 files changed

Lines changed: 116 additions & 1 deletion

File tree

docs/Developer Guide/!!!meta.json

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,45 @@
17201720
}
17211721
]
17221722
},
1723+
{
1724+
"isClone": false,
1725+
"noteId": "VHhyVRYK43gI",
1726+
"notePath": [
1727+
"jdjRLhLV3TtI",
1728+
"VHhyVRYK43gI"
1729+
],
1730+
"title": "Building and deployment",
1731+
"notePosition": 230,
1732+
"prefix": null,
1733+
"isExpanded": false,
1734+
"type": "text",
1735+
"mime": "text/html",
1736+
"attributes": [],
1737+
"format": "markdown",
1738+
"attachments": [],
1739+
"dirFileName": "Building and deployment",
1740+
"children": [
1741+
{
1742+
"isClone": false,
1743+
"noteId": "Un4wj2Mak2Ky",
1744+
"notePath": [
1745+
"jdjRLhLV3TtI",
1746+
"VHhyVRYK43gI",
1747+
"Un4wj2Mak2Ky"
1748+
],
1749+
"title": "Nix flake",
1750+
"notePosition": 10,
1751+
"prefix": null,
1752+
"isExpanded": false,
1753+
"type": "text",
1754+
"mime": "text/html",
1755+
"attributes": [],
1756+
"format": "markdown",
1757+
"dataFileName": "Nix flake.md",
1758+
"attachments": []
1759+
}
1760+
]
1761+
},
17231762
{
17241763
"isClone": false,
17251764
"noteId": "ibAPHul7Efvr",
@@ -1728,7 +1767,7 @@
17281767
"ibAPHul7Efvr"
17291768
],
17301769
"title": "Old documentation",
1731-
"notePosition": 230,
1770+
"notePosition": 260,
17321771
"prefix": null,
17331772
"isExpanded": false,
17341773
"type": "text",
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Nix flake
2+
Since TriliumNext 0.94.1, the desktop and server applications can be built using [Nix](https://nixos.org/).
3+
4+
## System requirements
5+
6+
Installation of Nix on Mac or Linux ([download page](https://nixos.org/download/)). About 3-4 gigabytes of additional storage space, for build artifacts.
7+
8+
## Run directly
9+
10+
Using [nix run](https://nix.dev/manual/nix/stable/command-ref/new-cli/nix3-run.html), the desktop app can be started as: `nix run github:TriliumNext/Notes/v0.95.0`
11+
12+
Running the server requires explicitly specifying the desired package: `nix run github:TriliumNext/Notes/v0.95.0#server`
13+
14+
Instead of a version (`v0.95.0` above), you can also specify a commit hash (or a branch name). This makes it easy to test development builds.
15+
16+
## Install on NixOS
17+
18+
Add to your `flake.nix`:
19+
20+
```
21+
{
22+
inputs = {
23+
nixpkgs.url = # ...;
24+
trilium-notes = {
25+
url = "github:TriliumNext/Notes/v0.95.0";
26+
inputs.nixpkgs.follows = "nixpkgs";
27+
};
28+
};
29+
30+
outputs =
31+
{
32+
self,
33+
# ...
34+
trilium-notes,
35+
...
36+
}:
37+
{
38+
nixosConfigurations = {
39+
"nixos" = nixpkgs.lib.nixosSystem {
40+
system = "x86_64-linux";
41+
modules = [
42+
./configuration.nix
43+
];
44+
specialArgs = {
45+
inherit
46+
trilium-notes
47+
;
48+
};
49+
};
50+
};
51+
};
52+
}
53+
54+
```
55+
56+
Add to your `configuration.nix`:
57+
58+
```
59+
{
60+
# ...
61+
trilium-notes,
62+
...
63+
}:
64+
65+
{
66+
# ...
67+
68+
services.trilium-server.package = trilium-notes.packages.x86_64-linux.server;
69+
70+
environment.systemPackages = [
71+
trilium-notes.packages.x86_64-linux.desktop
72+
];
73+
}
74+
```
75+
76+
The flake aims to be compatible with the latest NixOS stable and unstable.

0 commit comments

Comments
 (0)