modules: services: nextcloud: use 'credentialsfile'

In preparation for the migration to agenix.
This commit is contained in:
Bruno BELANYI 2021-09-25 13:02:13 +02:00
parent ac5fd7f472
commit ca218730ff
2 changed files with 9 additions and 5 deletions

View file

@ -91,7 +91,8 @@ in
# Nextcloud self-hosted cloud # Nextcloud self-hosted cloud
nextcloud = { nextcloud = {
enable = true; enable = true;
password = my.secrets.nextcloud.password; passwordFile =
builtins.toFile "nextcloud-pass.txt" my.secrets.nextcloud.password;
}; };
nginx = { nginx = {
enable = true; enable = true;

View file

@ -18,10 +18,13 @@ in
example = "admin"; example = "admin";
description = "Name of the admin user"; description = "Name of the admin user";
}; };
password = mkOption { passwordFile = mkOption {
type = types.str; type = types.str;
example = "password"; example = "/var/lib/nextcloud/password.txt";
description = "The admin user's password"; description = ''
Path to a file containing the admin's password, must be readable by
'nextcloud' user.
'';
}; };
}; };
@ -34,7 +37,7 @@ in
maxUploadSize = cfg.maxSize; maxUploadSize = cfg.maxSize;
config = { config = {
adminuser = cfg.admin; adminuser = cfg.admin;
adminpass = cfg.password; # Insecure, but I don't care adminpassFile = cfg.passwordFile;
dbtype = "pgsql"; dbtype = "pgsql";
dbhost = "/run/postgresql"; dbhost = "/run/postgresql";
overwriteProtocol = "https"; # Nginx only allows SSL overwriteProtocol = "https"; # Nginx only allows SSL