Merge pull request 'update the datastore spec for kubo' (#54) from fix-ipfs into main

Reviewed-on: #54
This commit is contained in:
Charlotte 🦝 Delenk 2023-05-23 05:58:23 +00:00
commit ba2ed3078a
Signed by: gitea-bot
GPG key ID: C9974EDF9932B558
4 changed files with 9 additions and 3 deletions

View file

@ -20,6 +20,7 @@ in {
./services/cups.nix ./services/cups.nix
./services/docker.nix ./services/docker.nix
./services/cifs.nix ./services/cifs.nix
./services/kubo-local.nix
]; ];
fonts = { fonts = {
fontDir.enable = true; fontDir.enable = true;

View file

@ -85,6 +85,7 @@
"d /build - - - - -" "d /build - - - - -"
"L /var/lib/nextcloud - - - - /persist/var/lib/nextcloud" "L /var/lib/nextcloud - - - - /persist/var/lib/nextcloud"
"d /persist/var/lib/nextcloud 0750 nextcloud nextcloud - -" "d /persist/var/lib/nextcloud 0750 nextcloud nextcloud - -"
"L /var/lib/ipfs - - - - /persist/var/lib/ipfs"
]; ];
services.postgresql.dataDir = "/persist/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}"; services.postgresql.dataDir = "/persist/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}";

View file

@ -332,8 +332,12 @@ in {
path = ["/run/wrappers" cfg.package]; path = ["/run/wrappers" cfg.package];
environment.IPFS_PATH = cfg.dataDir; environment.IPFS_PATH = cfg.dataDir;
preStart = preStart = let
datastore_spec = pkgs.writeText "datastore_spec" ''{"mounts":[{"bucket":"ipfs","mountpoint":"/"}],"type":"mount"}'';
in
'' ''
# Update the datastore_spec
ln -svf ${datastore_spec} $IPFS_PATH/datastore_spec
if [[ ! -f "$IPFS_PATH/config" ]]; then if [[ ! -f "$IPFS_PATH/config" ]]; then
ipfs init ${optionalString cfg.emptyRepo "-e"} ipfs init ${optionalString cfg.emptyRepo "-e"}
else else