nextcloud: write passwords using install

This commit is contained in:
Alexander Tomokhov 2023-11-26 09:08:14 +04:00
parent e814157437
commit a224731dcf

View file

@ -19,14 +19,15 @@
lib.mkIf sp.modules.nextcloud.enable lib.mkIf sp.modules.nextcloud.enable
{ {
system.activationScripts.nextcloudSecrets = '' system.activationScripts.nextcloudSecrets = ''
mkdir -p /var/lib/nextcloud install -m 0440 -o nextcloud -g nextcloud -DT \
${pkgs.jq}/bin/jq < ${secrets-filepath} -r '.modules.nextcloud.databasePassword' > ${db-pass-filepath} <(${pkgs.jq}/bin/jq < \
chmod 0440 ${db-pass-filepath} ${secrets-filepath} -r '.modules.nextcloud.databasePassword') \
chown nextcloud:nextcloud ${db-pass-filepath} ${db-pass-filepath}
${pkgs.jq}/bin/jq < ${secrets-filepath} -r '.modules.nextcloud.adminPassword' > ${admin-pass-filepath} install -m 0440 -o nextcloud -g nextcloud -DT \
chmod 0440 ${admin-pass-filepath} <(${pkgs.jq}/bin/jq < \
chown nextcloud:nextcloud ${admin-pass-filepath} ${secrets-filepath} -r '.modules.nextcloud.adminPassword') \
${admin-pass-filepath}
''; '';
fileSystems = lib.mkIf sp.useBinds { fileSystems = lib.mkIf sp.useBinds {
"/var/lib/nextcloud" = { "/var/lib/nextcloud" = {