Guest User

Untitled

a guest
Oct 8th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. #NextCloud config
  2.  
  3. { config, lib, pkgs, ... }:
  4.  
  5. {
  6. services.nextcloud.package = pkgs.nextcloud19;
  7.  
  8. services.nextcloud = {
  9. enable = true;
  10. hostName = "xxxxxxxxx";
  11. #nginx.enable = true;
  12. https = true;
  13. # Where?
  14. home = "/media/storage/nextcloud";
  15.  
  16. autoUpdateApps.enable = true;
  17.  
  18. config = {
  19. # Further forces Nextcloud to use HTTPS
  20. overwriteProtocol = "https";
  21.  
  22. # Nextcloud PostegreSQL database configuration, recommended over using SQLite
  23. dbtype = "pgsql";
  24. dbuser = "nextcloud";
  25. dbhost = "/run/postgresql"; # nextcloud will add /.s.PGSQL.5432 by itself
  26. dbname = "nextcloud";
  27. dbpassFile = "/var/nextcloud-db-pass";
  28.  
  29. adminpassFile = "/var/nextcloud-admin-pass";
  30. adminuser = "neothefox";
  31. };
  32. };
  33.  
  34. services.postgresql = {
  35. enable = true;
  36.  
  37. # Ensure the database, user, and permissions always exist
  38. ensureDatabases = [ "nextcloud" ];
  39. ensureUsers = [
  40. { name = "nextcloud";
  41. ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
  42. }
  43. ];
  44. };
  45.  
  46. systemd.services."nextcloud-setup" = {
  47. requires = ["postgresql.service"];
  48. after = ["postgresql.service"];
  49. };
  50. }
Add Comment
Please, Sign In to add comment