gerd.nextcloud: set default storage quota

This commit is contained in:
eyjhb 2024-08-15 11:11:58 +02:00
parent e84742d942
commit 21c34bc554
No known key found for this signature in database
GPG key ID: 609F508E3239F920

View file

@ -3,6 +3,8 @@
let let
svc_domain = "nextcloud.${config.mine.shared.settings.domain}"; svc_domain = "nextcloud.${config.mine.shared.settings.domain}";
default_storage_quota = "100MB";
# place data into own zfs dataset # place data into own zfs dataset
stateDir = config.mine.zfsMounts."rpool/safe/svcs/nextcloud"; stateDir = config.mine.zfsMounts."rpool/safe/svcs/nextcloud";
@ -91,6 +93,13 @@ let
echo "Ensuring everything is encrypted!" echo "Ensuring everything is encrypted!"
printf "y\n" | ${occ} encryption:encrypt-all printf "y\n" | ${occ} encryption:encrypt-all
# script for setting up tho storage quota
# possible to set based on groups
# https://github.com/nextcloud/groupquota
nextcloudSetupStorageQuota = pkgs.writeShellScript "nextcloud-setup-storage-quota.sh" ''
# set default quota
${occ} config:app:set files default_quota --value '${default_storage_quota}'
''; '';
in { in {
services.nextcloud = { services.nextcloud = {
@ -150,6 +159,7 @@ in {
${nextcloudSetupLdap} ${nextcloudSetupLdap}
${nextcloudSetupAdmin} ${nextcloudSetupAdmin}
${nextcloudSetupEncryption} ${nextcloudSetupEncryption}
${nextcloudSetupStorageQuota}
''; '';
# setup credentials for service # setup credentials for service