From 8afe40c87d94dfbedd8bfedaecd513323d6a318a Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Thu, 29 Aug 2024 23:56:07 +0200 Subject: [PATCH] Auto create necessary dirs for nextcloud --- hosts/stratus/containers/nextcloud/default.nix | 5 +++++ hosts/stratus/containers/nextcloud/nextcloud.nix | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hosts/stratus/containers/nextcloud/default.nix b/hosts/stratus/containers/nextcloud/default.nix index 0c95691..afcee8b 100644 --- a/hosts/stratus/containers/nextcloud/default.nix +++ b/hosts/stratus/containers/nextcloud/default.nix @@ -6,6 +6,11 @@ tailscale-auth-key = { }; }; + systemd.tmpfiles.rules = [ + "d /data/nextcloud - - -" + "d /data/postgresql - - -" + ]; + containers.nextcloud = { autoStart = true; ephemeral = true; diff --git a/hosts/stratus/containers/nextcloud/nextcloud.nix b/hosts/stratus/containers/nextcloud/nextcloud.nix index 8294370..f755f38 100644 --- a/hosts/stratus/containers/nextcloud/nextcloud.nix +++ b/hosts/stratus/containers/nextcloud/nextcloud.nix @@ -4,7 +4,10 @@ ... }: { - systemd.tmpfiles.rules = [ "z /run/secrets/nextcloud/admin-password 400 nextcloud nextcloud -" ]; + systemd.tmpfiles.rules = [ + "z /run/secrets/nextcloud/admin-password 400 nextcloud nextcloud -" + "z /data/postgresql 700 postgres postgres -" + ]; services.postgresql.dataDir = "/data/postgresql"; @@ -12,7 +15,7 @@ enable = true; package = pkgs.nextcloud29; home = "/data/nextcloud"; - hostName = "localhost"; + hostName = config.networking.fqdn; database.createLocally = true; config = { @@ -24,7 +27,6 @@ https = true; settings = { overwriteProtocol = "https"; - trusted_domains = [ config.networking.fqdn ]; log_type = "file"; default_phone_region = "DE"; maintenance_window_start = "2"; # UTC