mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
docs: add section on Nix flake
This commit is contained in:
parent
1de02b85b3
commit
e90d4cf86f
41
docs/Developer Guide/!!!meta.json
vendored
41
docs/Developer Guide/!!!meta.json
vendored
@ -1720,6 +1720,45 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"isClone": false,
|
||||||
|
"noteId": "VHhyVRYK43gI",
|
||||||
|
"notePath": [
|
||||||
|
"jdjRLhLV3TtI",
|
||||||
|
"VHhyVRYK43gI"
|
||||||
|
],
|
||||||
|
"title": "Building and deployment",
|
||||||
|
"notePosition": 230,
|
||||||
|
"prefix": null,
|
||||||
|
"isExpanded": false,
|
||||||
|
"type": "text",
|
||||||
|
"mime": "text/html",
|
||||||
|
"attributes": [],
|
||||||
|
"format": "markdown",
|
||||||
|
"attachments": [],
|
||||||
|
"dirFileName": "Building and deployment",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"isClone": false,
|
||||||
|
"noteId": "Un4wj2Mak2Ky",
|
||||||
|
"notePath": [
|
||||||
|
"jdjRLhLV3TtI",
|
||||||
|
"VHhyVRYK43gI",
|
||||||
|
"Un4wj2Mak2Ky"
|
||||||
|
],
|
||||||
|
"title": "Nix flake",
|
||||||
|
"notePosition": 10,
|
||||||
|
"prefix": null,
|
||||||
|
"isExpanded": false,
|
||||||
|
"type": "text",
|
||||||
|
"mime": "text/html",
|
||||||
|
"attributes": [],
|
||||||
|
"format": "markdown",
|
||||||
|
"dataFileName": "Nix flake.md",
|
||||||
|
"attachments": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"isClone": false,
|
"isClone": false,
|
||||||
"noteId": "ibAPHul7Efvr",
|
"noteId": "ibAPHul7Efvr",
|
||||||
@ -1728,7 +1767,7 @@
|
|||||||
"ibAPHul7Efvr"
|
"ibAPHul7Efvr"
|
||||||
],
|
],
|
||||||
"title": "Old documentation",
|
"title": "Old documentation",
|
||||||
"notePosition": 230,
|
"notePosition": 260,
|
||||||
"prefix": null,
|
"prefix": null,
|
||||||
"isExpanded": false,
|
"isExpanded": false,
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
76
docs/Developer Guide/Developer Guide/Building and deployment/Nix flake.md
vendored
Normal file
76
docs/Developer Guide/Developer Guide/Building and deployment/Nix flake.md
vendored
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# Nix flake
|
||||||
|
Since TriliumNext 0.94.1, the desktop and server applications can be built using [Nix](https://nixos.org/).
|
||||||
|
|
||||||
|
## System requirements
|
||||||
|
|
||||||
|
Installation of Nix on Mac or Linux ([download page](https://nixos.org/download/)). About 3-4 gigabytes of additional storage space, for build artifacts.
|
||||||
|
|
||||||
|
## Run directly
|
||||||
|
|
||||||
|
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`
|
||||||
|
|
||||||
|
Running the server requires explicitly specifying the desired package: `nix run github:TriliumNext/Notes/v0.95.0#server`
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
## Install on NixOS
|
||||||
|
|
||||||
|
Add to your `flake.nix`:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = # ...;
|
||||||
|
trilium-notes = {
|
||||||
|
url = "github:TriliumNext/Notes/v0.95.0";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
# ...
|
||||||
|
trilium-notes,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
nixosConfigurations = {
|
||||||
|
"nixos" = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./configuration.nix
|
||||||
|
];
|
||||||
|
specialArgs = {
|
||||||
|
inherit
|
||||||
|
trilium-notes
|
||||||
|
;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Add to your `configuration.nix`:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
# ...
|
||||||
|
trilium-notes,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
# ...
|
||||||
|
|
||||||
|
services.trilium-server.package = trilium-notes.packages.x86_64-linux.server;
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
trilium-notes.packages.x86_64-linux.desktop
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The flake aims to be compatible with the latest NixOS stable and unstable.
|
Loading…
x
Reference in New Issue
Block a user