aboutsummaryrefslogtreecommitdiff
path: root/cluster/prod/app/cryptpad/build/README.md
diff options
context:
space:
mode:
authoradrien <adrien@luxeylab.net>2024-04-18 17:35:36 +0000
committeradrien <adrien@luxeylab.net>2024-04-18 17:35:36 +0000
commit18e73b18f39ea19bae54fb4fae461e6c141b49ce (patch)
tree22bba1330f1e58716bba0812d831dec1c69d62c9 /cluster/prod/app/cryptpad/build/README.md
parent718a23b74bd13d09306bb17877ceec19464eed27 (diff)
parent9111997f845cb61bcbe5b5f49672ba26814d19c9 (diff)
downloadnixcfg-18e73b18f39ea19bae54fb4fae461e6c141b49ce.tar.gz
nixcfg-18e73b18f39ea19bae54fb4fae461e6c141b49ce.zip
Merge pull request 'cluster/prod(app): Upgrade CryptPad to 2024.3.0' (#23) from KokaKiwi/nixcfg:crytptpad-upgrade-1 into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/nixcfg/pulls/23
Diffstat (limited to 'cluster/prod/app/cryptpad/build/README.md')
-rw-r--r--cluster/prod/app/cryptpad/build/README.md61
1 files changed, 44 insertions, 17 deletions
diff --git a/cluster/prod/app/cryptpad/build/README.md b/cluster/prod/app/cryptpad/build/README.md
index 079d836..8e17406 100644
--- a/cluster/prod/app/cryptpad/build/README.md
+++ b/cluster/prod/app/cryptpad/build/README.md
@@ -1,29 +1,56 @@
-## Build
+# CryptPad for NixOS with Deuxfleurs flavour
-Cryptpad being not NixOS native, an upgrade must be done in 4 steps:
- 1. Bump the cryptpad version in `common.nix`
- 2. Rebuild the Nix lock files for the dependencies
- 3. Build the package for Nix
- 4. Create a container from the Nix package
+## Building
-To bump the nix version, set the desired tag in `common.nix` in the `cryptpadVersion` entry.
-Set the corresponding commit in the `cryptadCommit` field, its goal would be to detect unwanted update of the tag.
+The `default.nix` file follows the nixpkgs `callPackage` convention for fetching dependencies, so you need to either:
-To rebuild the lock files (they are stored in the `nix.lock` folder):
+- Run `nix-build --expr '{ ... }@args: (import <nixpkgs> {}).callPackage ./default.nix args'`
+- Do the `callPackage from a higher-level directory importing your package`
-```
-nix-shell --run "update_lock"
-```
+### Docker
-To build cryptpad:
+The `docker.nix` derives into a Docker image you can load simply by running:
+```shell
+docker load -i $(nix-build docker.nix)
```
-nix-build
+
+You can then test the built Docker image using the provided `docker-compose.yml` and `config.js` files, which are
+configured to render the instance accessible at `http://localhost:3000` with data stored into the `_data` folder.
+
+
+### Deuxfleurs flavour
+The `deuxfleurs.nix` file derives into two derivations: The CryptPad derivation itself and a Docker image,
+which can be choose by passing the `-A [name]` flags to `nix-build`
+
+For example, to build and load the Deuxfleurs-flavoured CryptPad Docker image, you run:
+
+```shell
+docker load -i $(nix-build deuxfleurs.nix -A docker)
```
-Create the container:
+## OnlyOffice integration
+Apart for `deuxfleurs.nix`, both `default.nix` and `docker.nix` files build CryptPad with a copy of OnlyOffice pre-built and
+used by CryptPad, which can result to large Docker image (~2.6GiB)
+This behaviour is configurable by passing the `--arg withOnlyOffice false` flag to `nix-build` when building them.
+
+## Updating the Deuxfleurs pinned nixpkgs
+The pinned sources files are generated with the [niv](https://github.com/nmattia/niv) tool.
+
+To update the pinned nixpkgs, you simply run the following command:
+
+```shell
+niv update
```
-docker load < $(nix-build docker.nix)
-docker push superboum/cryptpad:???
+
+To modify the pinned nixpkgs, you can use the `niv modify` command, for example, to move to nixpkgs-unstable:
+
+```shell
+niv modify nixpkgs -b nixos-unstable
```
+
+## Quirks
+
+- The CryptPad `package-lock.json` is included here because the upstream-provided one appeared to be desync'ed, so a
+ manual lockfile generation was needed