mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-25 16:08:30 +02:00
added nextcloud
This commit is contained in:
parent
1dfcdd7d7c
commit
a8dfc9276e
5 changed files with 125 additions and 1 deletions
64
hosts/nuc/modules/nextcloud/default.nix
Normal file
64
hosts/nuc/modules/nextcloud/default.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
domain = "nextcloud.rfive.de";
|
||||
in
|
||||
{
|
||||
sops.secrets = {
|
||||
"nextcloud/dbpass" = {
|
||||
owner = "nextcloud";
|
||||
group = "nextcloud";
|
||||
};
|
||||
"nextcloud/adminpass" = {
|
||||
owner = "nextcloud";
|
||||
group = "nextcloud";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
postgresql = {
|
||||
enable = true;
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "nextcloud";
|
||||
ensurePermissions = {
|
||||
"DATABASE nextcloud" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
];
|
||||
ensureDatabases = [ "nextcloud" ];
|
||||
};
|
||||
|
||||
nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud25; # Use current latest nextcloud package
|
||||
hostName = "${domain}";
|
||||
https = true; # Use https for all urls
|
||||
config = {
|
||||
dbtype = "pgsql";
|
||||
dbuser = "nextcloud";
|
||||
dbhost = "/run/postgresql";
|
||||
dbname = "nextcloud";
|
||||
dbpassFile = config.sops.secrets."nextcloud/dbpass".path;
|
||||
adminpassFile = config.sops.secrets."nextcloud/adminpass".path;
|
||||
adminuser = "admin";
|
||||
};
|
||||
};
|
||||
|
||||
# Enable ACME and force SSL
|
||||
nginx = {
|
||||
recommendedProxySettings = true;
|
||||
virtualHosts = {
|
||||
"${domain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# ensure that postgres is running *before* running the setup
|
||||
systemd.services."nextcloud-setup" = {
|
||||
requires = [ "postgresql.service" ];
|
||||
after = [ "postgresql.service" ];
|
||||
};
|
||||
}
|
10
hosts/nuc/modules/nginx/default.nix
Normal file
10
hosts/nuc/modules/nginx/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.nginx.enable = true;
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults = {
|
||||
email = "rouven@rfive.de";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue